View Full Version : Changing AVC Level after encoding
pspvideo9
25th February 2007, 06:59
We've encoded a few videos at a low resolution, framerate and bitrate but left the AVC level setting to default (5.1). We'd like to change it to a lower level but do not want to re-encode it. Is there a way to change the AVC level of a video without re-encoding it?
According to the MeGUI docs the AVC level (level_idc) is simply a "nominal value written into the bitstream". Does that mean we could simply overwrite the level_idc bit to change its level (provided that the resolution, framerate and bitrate are within the new level)?
ChronoCross
25th February 2007, 07:01
The level is also determined by various other factors such as what features are enabled, the vbv buffer among other things. The only way to change a level is by re-encoding or by rewriting that value and hoping that the encode falls within the levels specs.
Manao
25th February 2007, 10:24
You can change it. It doesn't depends on the enabled features, only on resolution / bitrate / vbv / framerate ( ie, the profile defines the features while the level defines the processing power needed to decode )
Just get the h264 standard, find where the level is written ( it's easy ), then hexedit the file to change the value. It won't break anything ( luckily, that part of the file isn't written in cabac, else it wouldn't have been possible ). You can also specify an uncompliant level. Software players won't care. Hardware ones are a bit more picky though...
ChronoCross
25th February 2007, 20:12
that's right. my bad. I forgot that the level doesn't specify the profile.
although it seems a little wierd because you could have low bitrate vbv resoultion and if you activate say high profile the video becomes exponentially harder to decode. oh well.
Manao
25th February 2007, 20:25
High profile isn't that harder to decode. Don't expect more than 5% increase in decoding time for the same resolution/framerate/bitrate.
pspvideo9
25th February 2007, 22:15
Well all of the resolution / bitrate / vbv / framerate are within acceptable limits for the new level we want to set it to. Unfortunately, we encoded our main profile unrestricted video with the P4x4 macroblock partition setting on. This means setting the video to level 4.1 will break compliance with spec.
None the less we're still interested to see if the video will actually play on the PS3 at the new patched level and with P4x4 on.
bond
25th February 2007, 23:07
for the sake of the format it might be better to not spread tools being able to set wrong levels :D
edit: apart from that, when testing you would need to make sure to use a stream that really uses p4x4
pspvideo9
26th February 2007, 22:22
Is there some sort of free tool that will tell me if a stream really uses P4x4?
Perhaps something in the h264_parse readout?
Or would this require a professional tool?
akupenguin
27th February 2007, 06:04
ldecod.trace -i foo.264 ; grep 'sub_mb_type.*3' trace_dec.txt
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.