1

I have encoded videos from image sequences with ffmpeg, some play in omxplayer, some don't. Looking at them with -I shows they use different pixel format, the one that works uses yuv420p, the one that doesn't yuv444p (another difference is that it says "Predictive").

Works:

$ omxplayer --no-osd -I works.mp4 
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'works.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.41.100
  Duration: 00:07:38.40, start: 0.000000, bitrate: 6958 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 1024x1024 [SAR 1:1 DAR 1:1], 6958 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Video codec omx-h264 width 1024 height 1024 profile 100 fps 25.000000
Subtitle count: 0, state: off, index: 1, delay: 0
V:PortSettingsChanged: 1024x1024@25.00 interlace:0 deinterlace:0 anaglyph:0 par:1.00 display:0 layer:0 alpha:255 aspectMode:0

Doesn't show video:

$ omxplayer --no-osd -I broken.mp4 
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'broken.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.41.100
  Duration: 00:00:57.60, start: 0.000000, bitrate: 1432 kb/s
    Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p, 1024x1024, 1429 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Video codec omx-h264 width 1024 height 1024 profile 244 fps 25.000000
Subtitle count: 0, state: off, index: 1, delay: 0

Is this a limitation of omxplayer? Can I use a high quality encoding such as yuv444?


Edit: Here is the ffmpeg document that lists the "profiles" that one could enforce. Is there any statement which profiles omxplayer does not support (apparently high444 is one)?

3

The problem

libx264 supports multiple "pixel formats", so ffmpeg will automatically attempt to use whatever most closely matches the input. However, some players can't decode anything other than yuv(j)420p.

The solution

Add -vf format=yuv420p (or the alias -pix_fmt yuv420p) output options to your encoding command.

See Encoding for Dumb Players in the link you provided.

  • Ok, thanks, I can confirm that adding -pix_fmt yuv420p works. – 0__ Nov 8 '16 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.