On Mon, 22 Sep 2003, Maarten De Boer wrote:

> > dvgrab --format raw - | raw2yuv | yuvplay
> 
> okay, this works fine! (which indicates that lav2yuv is incompatible

        Hurrah!

> with dvgrab output in dv1/dv2 mode... as I understand (correct me
> if I'm wrong) because dvgrab, through libdv, outputs YUV422 and lav2
> expects YUV420. will this be fixed?)

        It already is fixed - at least somewhat so.

        In the lavtools/ directory you'll find ifdef'd sections of
        code like this:

#ifdef LIBDV_PAL_YV12
       lav_fd->MJPG_chroma = CHROMA420;
#else
       lav_fd->MJPG_chroma = CHROMA422;
#endif

        Now I am becoming confused.   

        If mjpegtools is configured without --with-dv-yv12 then
        lav2yuv is expecting 4:2:2 for PAL.   If --with-dv-yv12
        IS used then lav2yuv will expect 4:2:0.    At this point if
        libdv is using 4:2:0 (which i think it is) and lav2yuv is
        expecting 4:2:2 then that is the cause of the problem.

        It is not run time selectable though.

        In libdv I could not find any evidence that resampling from
        4:2:0 to 4:2:2 is being done.   I might have missed it though.

> Now, if I try to encode a raw dv stream with
> 
> cat foo.raw | raw2yuv -a output.wav -i 0 | yuvscaler -n n -O SVCD |
> mpeg2enc -q 10 -a 2 -f 4 -F 3 -S 800 -B 192 -I 1 -o output.m2v
> 
> this works okay (I am not sure what to think of the quality,
> since I am used to divx...) but...

        -q 10 is a little low, perhaps 9 or even 8 would help if you
        have time to experiment.

> The resulting mpeg2 file, at least according to mplayer, has an
> video bitrate of 2500. Which should not occur, since I specify that
> the output is SVCD (-f 4), and the audio bitrate is 192. Now, even

        That's perfectly correct.  The maximum video bitrate for
        SVCD is 2500 kbits/sec (some players will accept much higher
        rates but for compatibility 2500 is the value to use) - and
        mpeg2enc sets that as the rate to use with -f 4.

        2500 kbits/sec is marginal for SVCD - 480x576 (480x480) is a lot
        of data for only 2500 kbits/sec.   

> if I specify a lower video bitrate by hand ( -b 1000 for example),
> the result it (binary) identical! Is this a bug in mpeg2enc, or am I
> missing something?

        Yes :)

        -f 4 sets all the necessary SVCD parameters and those override
        user supplied values.

        If you want to specify your own parameters (and SVCDs will
        look terrible at 1000 kbits/sec) use "-f 5" instead.  You will
        need to specify more parameters (possibly the -V value at least).

> By the way, raw2yuv allows to specify an output file for the audio,
> either wav or mp2. For mp2 however, there are no additional flags
> to influence the encoding. Is there any way to specify how to encode
> the mp2?

        That is why I use either lav2wav or smil2wav and run the
        mp2enc or toolame command manually.   The one advantage that
        mp2enc has over toolame is that it will resample from 48000 to
        44100.  The standalone players I have used will accept SVCDs
        with 48000 rate audio but that is not standard so some players
        might reject it.

        Steven Schultz



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to