30 August 2007 @ 11:56A More Efficient Use of Your Bits?
Do you have a lengthy video that you are encoding for DVD? Is the length long enough that you have to reduce the bitrate in order to make it fit? Here is a trick that will theoretically give you better quality at the same bitrate for the same duration of video.
I have determined that my 3hour_video.dv needs to be re-encoded to mpeg2 at a bitrate of 3192kbps with my audio at 192kbps. There is not much I can do about the bitrate. If I set the bitrate higher, the video won’t fit a standard DVD5 (4.37GB). If I set the bitrate lower, of course, the quality will suffer (and it is suffering enough already).
I will instead reduce the dimensions of the video to 668×436 and pad all four sides (top:20,bottom:24,left:26,right:26) in order to make it 720×480 again. If I view full-frame the resulting video, I will see a black border around the picture. This is where I am saving bits. When I play the DVD on most TVs, I will not see the black border (except of course the top and bottom letterboxing), because of what is referred to as overscan. Overscan varies from television to television.
ffmpeg -i 3hour_video.dv -target ntsc-dvd -b 3192k -maxrate 7500k -aspect 16:9 -s 668x436 -padtop 20 -padbottom 24 -padleft 26 -padright 26 -acodec ac3 -ac 2 -ab 192 3hour_video.mpg
I do realize that it is within spec to resize the video to 352×480, but I am often displeased with the results which include loss of detail and jagged diagonal lines.
With some videos you may want to crop all sides by a few pixels (especially the top and bottom, which are more likely to be seen) in order give the video a sharp edge instead of a soft one.
Note that the above dimensions are for NTSC video. For PAL, the dimensions would be 676×532 and the padding would be (top:20,bottom:24,left:22,right:22).