On Wed, 5 Apr 2006, Nicolas wrote: > I use mpeg2enc and mplex to create my DVD from videos made with > Cinelerra. Cinelerra outputs an YUV4MPEG stream which I encode "on the > fly" with mpeg2enc. Here's the pipe I use :
Let's play "find the be incorrect options" game :) > /usr/bin/yuvcorrect -T INTERLACED_BOTTOM_FIRST | /usr/bin/yuvscaler -v 0 hmmm - Cinelerra getting the field order wrong? > -I ACTIVE_702x560+8+8 -M BICUBIC | /usr/bin/mpeg2enc -v 0 -r 32 -4 1 -2 > 1 -V 1853 -s -D 1 0 -g 6 -G 15 -I 1 -b 9800 -D 10 -f 8 -o $1 Is that a typo? "-D 1" is an illegal value. The argument to -D needs to be 8, 9 or 10. Also, a search radius of 32 is past the point of diminishing returns, all it's doing is slowing the process down. 24 may be of some value but 32? Doubtful. -I 1 isn't needed - mpeg2enc will do the right thing without it. -s isn't needed (-f 8 does that for the DVD format). -V 1853 is ABSURDLY high. That value is the amount of "buffering" in KB for the stream. I REALLY DOUBT that any DVD player being made will have 1853 * 1024 bytes of memory for buffering the MPEG-2 data ;) IF the default (for -f 8) of 224 (KB) does not work then the '-b' value is too high. Don't use the max bitrate for '-b'! True, the DVD specs say the max rate from DVD is 10.08 but that includes the video stream, audio stream AND navigation info. Also, as has been mentioned many times before, using a max value doesn't 1) leave any room for spikes/peaks in the rate which can cause some players to have problems and 2) may cause problems with recordable media in some players. Some players have trouble reading recordable media at very high rates. Some players work fine. Do you know what players everyone will be using? ;) > I also output an AC3 audio stream, and I use mplex to create the mpeg > video: > mplex -f 8 -b 1835 -r 10404 audio.ac3 video.m2v -o movie.mpeg Again, if the stream is properly formed you don't need to specify a bogusly high value of '-b'! Even HIGH DEFINITION MPEG-2 only needs '-b' of 488 (KB)! No need to specify '-r' if the stream is DVD compatible. > However, I noticed a strange thing in mplex output : > INFO: [mplex] Video Stream length: 505039125 bytes > INFO: [mplex] Sequence headers: 727 > INFO: [mplex] Sequence ends : 1 > INFO: [mplex] No. Pictures : 10904 > INFO: [mplex] No. Groups : 727 > INFO: [mplex] No. I Frames : 727 avg. size 58042 bytes > INFO: [mplex] No. P Frames : 10177 avg. size 45479 bytes > INFO: [mplex] No. B Frames : 0 avg. size 0 bytes > > There seems to be no B frame at all in the mpeg. That's strange since That's (usually) a good thing! Oh, no b frames MAY cause SOME players to have difficulty with smooth fast forward playing but if that's not important then don't use B frames. > Note: Mpeg2enc is currently hard-wired to produce 2 B frames between > each I/P frame unless the GOP size forces less. This is reasonable for That option is only effective if you're using B frames ;) -R sets the number of B frames. By default it is 0. > -P|--force-b-b-p > This flag forces the GOP size selection to choose sizes that ensure > 2 B frames appear between adjacent I/P frames. Several common MPEG-1 > decoders can't handle streams where less than 2 B-frames appear between > I/P frames. You're not generating MPEG-1 and that comment was written years ago. ALSO "B frames" have always been an optional part of the MPEG specs, so there's NOTHING that says they MUST be used. > What's wrong? Did I use a wrong setting? I really would like to get 2 B Other than a bunch of incorrect options you're doing fine :) :) > frames in each GOP, to get the best image quality (as you probably > noticed, I encode in CBR at 9800 kbps). Who told you B frames improve quality? In *some* cases using B frames with pristine (extremely clean) source material you *may* see *some* quality improvement. I think you'd be much better off with just fixing up the commands and staying with "-R 0" (no b frames). BUT if you want to try something that might be useful try adding "--dualprime-mpeg2" to the mpeg2enc options. However, if you've any noise at all what you gain with smaller B frames you lose with larger P frames. Check the mailinglist archives for the previous discussions - in fact there was mention fairly recently i think. Cheers, Steven Schultz ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Mjpeg-users mailing list Mjpeg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mjpeg-users