On Thu, 23 Nov 2006, Richard Rasker wrote:

> question I have deals with one of the elusive Holy Grails of video
> processing: how to render a given DV file into the highest possible
> quality DVD.

        In addition to being a holy grail it is also known as a 'wild goose
        chase' ;)

        Actually it's not all that hard once you wrap your brain around that
        fact that a few extra kbits/sec for video is NOT going to make
        any difference at all in visual quality.

> mplex to merge both files, only to find that either the maximum bit rate
> and/or quantization value for DVD has been exceeded. After which I

        The bitrate is the only thing that is (or can be) exceeded.  There is
        no such concept as "quantization value for DVD being exceeded".

> Sometimes it takes three attempts to reach the optimal values, and with...
> 
> Example of the render pipe command:
> yuvcorrect -v 0 -T INTERLACED_BOTTOM_FIRST | mpeg2enc -M 2 -v 0 -r 32 -4
> 1 -2 1 -D 10 -g 15 -G 15 -q 5 -b 9600 -f 8 -o %

        For one thing you could speed up the coding by deleting the "-r 32".
        That is past the point of diminishing returns - i.e. you gain almost
        nothing over the default "-r 16" but the encoding time is longer.
 
        I'm curious why 'yuvcorrect' is being used.  DV is always bottom
        field first - is something earlier in the pipeline mangling the
        field order tag?

        -M is either useless (no speed gain) or worse (subtle threading 
        race can trigger an assert() error).

        And 9600 is too high for a bitrate value.  Try 8800 or even a little
        lower.

> It would be nice if there was a tool to calculate which values for bit
> rate and quantization would still result in a valid DVD MPEG file, based
> on a given DV file, without actually having to go through the lengthy
> rendering process itself. Does such a 'video complexity analyzer' exist?

        Yes, there is - it's called 'mpeg2enc' :)

        mpeg2enc IS analyzing the file and mpeg2enc IS adjusting the 
        quantization to meet your specified bitrate.

        All that you need to do is use a sane value for the bitrate and
        the output will be fine.  

        I am not sure what you mean by "calculate quantization" - the encoder 
        will calculate and vary that to stay within the bitrate you've given.  

        IF you mean the quantization floor (amount of compression) that "-q" 
        represents then that's probably not what you think it is (granted the 
        documentation is a bit awkward and it is a confusing concept).  

> I couldn't find anything, but I'm still rather unfamiliar with the
> actual intricacies of MPEG and the likes.

> So, are there any thoughts on this?

        The topic has been discussed MANY times on this mailing list.  A little
        searching with bitrate related search criteria should yield quite a 
        few hits.

        Basically the problem is folks see "10.08 megabits/sec" and the DVD
        rate and try to use too much of that for video.  That max rate has
        to not only handle the muxing overhead (general guide I use is 2%)
        AND more IMPORTANTLY video bitrate spikes.  mpeg2enc's rate control
        is excellent but rate spikes are a fact of life. 

        Assume the audio rate is 224Kb/s (a commonly used value for MP2).

        So out of the 10.08 and subtracting overhead, audio and allowing for
        10% rate spikes we end up with about 8680.  So, to be completely
        safe around 8600 to 8700 would be the highest value I'd use.
        Maybe even be a little more conservative and use 8500.

        Really - you won't see the difference between 8600 and 8800 or even 9000

        Often the question/problem is how to calculate a bitrate in order to
        fit a N minute movie on a DVD.  For THAT there is a simple rule
        that will provide a good starting point.  I won't bore you with the
        derivation (it's off in the DVD Studio Pro books/documentation) but
        given a movie length N (in minutes):

            bitrate (Mb/s) = 560 / N

        For a 90 minute movie, 560 / 90 = 6.222 so "-b 6500"  would be a
        good starting point.  

        With dual layer media use 1012 instead of 560 ( the two layers are
        not the same size, that's why the figure is not simply 2x the single
        layer value).

        Good Luck!

        Cheers,
        Steven Schultz


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to