[MEncoder-users] H.264 levels, -x264encopts level_idc=xx. Was: Why can't the PS3 play the mp4s produced by this mencoder command?
stroller at stellar.eclipse.co.uk
Mon Sep 29 16:28:26 CEST 2008
On 29 Sep 2008, at 14:21, briaeros007 wrote:
> Good to know it help you ;).
> I'm not to sure about the level myself.
> In one hand, the encoder could (and should) enforce the level
> constraint on the video.
> In the other hand, the level is just a flag in the head of one nal (an
> h.264 packet) (and not all nal, just some specific nal), so the
> encoder (or a little script) could change the level of a video, even
> if the constraint are not (always) respected, and it will be all up to
> the decoder to manage this stream.
> For mencoder, it seem to use the second method for the bitrate :
> Example :
> I use this command to encode with level 30 :
> mencoder -nosound -ovc x264 -x264encopts bitrate=2000:level_idc=30
> -demuxer rawvideo -rawvideo w=720:h=480 stream2.yuv -frames 1000 -o
> test.h264 -of rawvideo -ofps 25
> It print x264 [info]: kb/s:2123.7
> 11M test.h264
> 1000 frames/25 fps => 40 seconds
> 11M bytes/40 seconds => 2252.8 kbits/s
> And i verified (in hexa) that the level is the good one in the file ;)
> (if you want to verify yourself :
> use an heximal editor of your file and search
> after this code, you will have thre other bytes :
> XX Y0 ZZ
> XX -> it's the profile :66 for baseline, 77 for main and 88 for
> (it can be also 100 for high, 110, 122 ...)
> Y it's the flag constraint
> ZZ it's the level_idc.
> In this case ZZ=30 (4D), and XX=77(0x1E)
Thank you so much for your help - you have been VERY informative.
More information about the MEncoder-users