H264 2 Pass encoding - how low can you go?

sheppy99

New member
I've been converting MPEG2 SD TV into H264 High 3.1 Profile with 2 pass encoding and wonder how low I can drop the average bitrate to before I notice a loss of quality if I leave the peak bitrate much higher. Currently I'm working at around half the average MPEG2 bitrate with the peak set at 1 1/2 the MPEG2 average bitrate and the results are pretty good.
Does anyone have any thoughts on this? I realise I could just leave it as MPEG2 but space is tight
 
Last edited:

Dan203

Senior Developer
Staff member
The encoder always tries to keep the average bitrate consistent. So even if you set the max bitrate really high the average across the whole file will still be somewhere near the average value set. What this means is that if during encoding you hit a really high motion scene that needs the max the encoder will then have to drop way below the average for the next slow scene to compensate. 2 pass encoding can chart these highs and lows more efficiently, which produces better perceived quality at lower bitrates, but you still have to be careful not to drop too low or you will start to see compression artificats.

Personally I would say that a 40% reduction in bitrate over the source is probably about as low as you want to go when you're converting MPEG-2 to H.264 and all other parameters are left the same.

Dan
 

sheppy99

New member
Thanks for the clarification, any chance you could develop something quality based, ideally using the high profile as win7's media foundation decoder supports it.
Thanks
 

Dan203

Senior Developer
Staff member
I actually just finished adding a basic quality mode to VRD which should be in the next release. It doesn't do a frame by frame analysis of the whole video, but it uses a calculation to determine a quality factor for the current video (i.e. BR/(FPS*Pixels)), adjusts it by a percentage for conversion (i.e. if source is MPEG-2 and output is H.264 reduce QF by 30%) then recalculates the the bitrate by reversing the formula and using the output variables. (i.e. if resolution or frame rate have also been reduced then the BR will be even lower)

Starting with the next release this new mode should be default for all Intelligent profiles, so you will be able to open an MPEG-2 file, make edits and save to an H.264 profile with no modifications to the options, and get a file that is of equivalent quality to the source but 20-30% smaller. It wont be optimized to to make the smallest file possible, but it will make it effortless to convert between formats while retaining the quality and getting respectable file size gains.

Dan
 

TestDemo

New member
I actually just finished adding a basic quality mode to VRD which should be in the next release. It doesn't do a frame by frame analysis of the whole video, but it uses a calculation to determine a quality factor for the current video (i.e. BR/(FPS*Pixels)), adjusts it by a percentage for conversion (i.e. if source is MPEG-2 and output is H.264 reduce QF by 30%) then recalculates the the bitrate by reversing the formula and using the output variables. (i.e. if resolution or frame rate have also been reduced then the BR will be even lower)

Starting with the next release this new mode should be default for all Intelligent profiles, so you will be able to open an MPEG-2 file, make edits and save to an H.264 profile with no modifications to the options, and get a file that is of equivalent quality to the source but 20-30% smaller. It wont be optimized to to make the smallest file possible, but it will make it effortless to convert between formats while retaining the quality and getting respectable file size gains.

Dan
Will there be the option to force a certain quantization parameter?
 

Dan203

Senior Developer
Staff member
The only option will be to set the percentage used when adjusting the quality factor to a different codec. So for example when going from MPEG-2 to H.264 the default adjustment will be 70%, meaning that all other things being equal the bitrate used to encode the H.264 file will be 30% lower then the original source bitrate. However you could set it as low as 50% which would basically cut the bitrate in half. (the calculation also takes into account FPS and resolution, so if you lower either of those the bitrate will also be adjusted to compensate for that)

Quantization and other advanced encoding parameters are not considered at all in this feature. This is simply a way to automatically adjust the bitrate to compensate for codec, frame rate and resolution changes.

Dan
 
I actually just finished adding a basic quality mode to VRD which should be in the next release. It doesn't do a frame by frame analysis of the whole video, but it uses a calculation to determine a quality factor for the current video (i.e. BR/(FPS*Pixels)), adjusts it by a percentage for conversion (i.e. if source is MPEG-2 and output is H.264 reduce QF by 30%) then recalculates the the bitrate by reversing the formula and using the output variables. (i.e. if resolution or frame rate have also been reduced then the BR will be even lower)
Dan, is your calculations based on the video file or the video stream? This does make a difference.

Starting with the next release this new mode should be default for all Intelligent profiles, so you will be able to open an MPEG-2 file, make edits and save to an H.264 profile with no modifications to the options, and get a file that is of equivalent quality to the source but 20-30% smaller. It wont be optimized to to make the smallest file possible, but it will make it effortless to convert between formats while retaining the quality and getting respectable file size gains.
Dan
So this will be a forced recode then? You say Intelligent but this is really a recode.

Also, how would we differentiate between wanting to save as MPEG-2 (.mpg or .ts) vs H264?

Mike
 
Top Bottom