Can't play h264 video with yuvj422p pixel format

REPRODUCIBILITY: 100%
OS VERSION: 4.4.0.68
HARDWARE: Xperia 10 II
UI LANGUAGE: Czech
REGRESSION: No

DESCRIPTION:

I discover that some video files cannot be played in Sailfish OS. Moreover, Gallery app freeze after try to play them. During my investigation, I find out that difference is in pixel format. When pixel format yuv420p is used, video is played properly. Not sure if this issue is caused by old libx264 or it is limitation of Xperia 10.II hardware…

PRECONDITIONS:

no preconditions

STEPS TO REPRODUCE:

convert some video to yuvj422p (on computer):

scp xperia:/home/defaultuser/Videos/Default/Sailfish_OS_3.0.mp4 . 
ffmpeg \
  -i Sailfish_OS_3.0.mp4 \
  -codec:a copy \
  -codec:v libx264 \
  -pix_fmt yuvj422p \
  test-yuvj422p.mp4

scp test-yuvj422p.mp4 xperia:/home/defaultuser/Videos/

Then try to open test-yuvj422p.mp4 in Gallery app.

EXPECTED RESULT:

Video is played. Or some warning is displayed. Or - Gallery app is not freezing - at least :wink:

ACTUAL RESULT:

Video cannot be played, Gallery app freeze.

MODIFICATIONS:

No

ADDITIONAL INFORMATION:

No

2 Likes

I’ve been updating a bunch off ffmpeg commands (Videoworks) and noted that libx264 requires additional libs (from lpr on openrepos, I believe?). If i recompress on device with, say, mpeg4 as codec, yuvj422p is automatically removed and yuv420p is automatically selected.

The exact message, when trying to encode on the phone:

Incompatible pixel format 'yuvj422p' for codec 'mpeg4', auto-selecting format 'yuv420p'
[swscaler @ 0x32f91f90] deprecated pixel format used, make sure you did set range correctly

same here on my Jolla1 running SFOS 3.4
encoding on the phone works (you’ll need libx264 + ffmpeg(x264-enabled in build-options))
but in any videoplayer using gstreamer, the app freezes when trying to play the yuvj422p.mp4 file.
It seems the gstreamer1.0-droid library is not signalling correctly that it cannot handle yuvj422p with the phones mp4 hardware codec…
My version of ffmpeg with fully enabled h264 decoders and enabled ffplay can play the file without freeze/error via software decoder.

Installed it right now on Xperia 10 (not yet tested), but no option to install in Storeman on the Volla phone. Is it only for 32 bit?

what did you install? My version of ffmpeg is not available anywhere, I did not upload it, not 32bit nor 64bit

I installed from Storeman/categories/libraries, there i searched for ffmpeg using the search potion (pull down menu).
In the search results I found ‘dav1d’ (30.5.22) and ‘libmodplug’ (2.6.22) contributed by you and not installed on my X10. So I installed it.

but jollas ffmpeg packages cannot make use of them. You have to build your own ffmpeg packages (you’ll need devel-packages and build-switches too) to make use of it.

btw: dav1d gives you AV1 decoding support and libmodplug mod-file support, but this is completely off topic here?!

1 Like

OT: i only installed them for interest, because i read here.

Thanks @karry for flagging this up, and especially for including the ffmpeg command. That makes things much easier to reproduce.

I’ve created any internal report about it and tagged it as “tracked”. I’ll do my best to share any updates about it here.

1 Like