On Sun, 31 Oct 2004, sreekant kodela wrote: > Hence I rendered the images to jpeg shots from > cinelerra. I thought it would > be a matter of using mjpegtools and just create the > necessary mpeg2 video > file from it, then mplex the mp3 or mp2 whatever. But > no, it does not work that way. It would work fine if sensible parameters to mpeg2enc and mplex are specified.
> I used the command as below > > #find . -name='*.jpg' | sort | xargs -n1 jpegtopnm | > ppmtoy4m | mpeg2enc -f 8 -b 14000 -s -n p -F 3 -a 2 -c > -B 3000 -o final.mpeg > 14000 is much too high. "-f 8" implies you're creating a DVD and the DVD maximum video rate is 9800. Oh, and 15000 is the maximum bitrate allowed for a [EMAIL PROTECTED] MPEG-2 encoder so if you've tried anything higher than 15000 mpeg2enc is correct in rejecting the value. > but with -b ranging from 8000 to 40000 and -B ranging > from 300 to 3000. No -B simply tells the encoder what the estimated audio bitrate is and 3000 is far too high (uncompressed 48000Hz audio is only about 1600 kbits/sec - so 3000 is equivalent to two stereo uncompressed PCM audio streams). -B isn't really needed for DVD encoding. The main use of -B is for SVCD/VCD encoding where the encoder needs to know where to put "split points' in the output stream. > Is there anyone who can tell me what I need to do to make a mpeg2 stream... Use reasonable parameters ;) > the 41000 jpegs and mplex it with equal time length > audio in mp3 or mp2 > format to put it on disk and play on stand alone dvd player!! Well, hmm - if you're going to make a DVD that will play in a standalone player then DO NOT CHANGE the defaults to the encoder. Values such as 14000 and 3000 are far out of specification for a DVD. The defaults will work just fine for now. > A simple "mpeg2enc -f 8 -o final.mpg" should work. IF that does not work then the input stream is incorrectly formed. Make certain that for "PAL" the input is 720x576 (or 704x576, or 352x576) in size, the SAR (Sample Aspect ratio) is 59:54, and the frame rate is 25. If you have .jpg images that were generated on a computer the chances are good that you were using square pixels. The data needs to be resampled/scaled to 59:54 pixels for a 625line ("PAL") stream. Something like this before the encoder might do the job (but this has not been tested): ppmtoy4m -A 1:1 -F 25:1 | \ y4mscaler -O sar=59:54 -O preset=DVD -S option=sinc:4 | \ mpeg2enc -f 8 -q 4 -o final.m2v If things don't look right (borders, etc) then there's a good chance the images weren't created at the correct size. For "PAL" you need to create the images at 768x576 and then scale to 720x576 (for 525line systems you can either create the images at 640x480 and scale to 720x480 or at 720x534 and then scale to 720x480). > #mplex -f 8 -o final.mpeg final.m2v final.mp2 barfs at > me like below. > > INFO: [mplex] mplex version 1.6.2 (2.2.3 $Date: 2004/01/13 20:45:26 $) > INFO: [mplex] File final.m2v looks like an MPEG Video stream. > INFO: [mplex] File final.mp2 looks like an MPEG Audio stream. > INFO: [mplex] Found 1 audio streams and 1 video streams > INFO: [mplex] VIDEO STREAM: e0 > INFO: [mplex] Frame width : 720 > INFO: [mplex] Frame height : 576 > INFO: [mplex] Aspect ratio : forbidden Hmmm, illegal value in the "Aspect". That might be an indication that the input stream isn't 100% correctly formed. > INFO: [mplex] Picture rate : 25.000 frames/sec > INFO: [mplex] Bit rate : 24000000 bits/sec Yes, at that bitrate (and 24000 Kb/s is way out of bounds) I'd expect mplex to give errors. If you encode the stream usinng DVD valid values then mplex will not complain. > ======================================================================== > Trying with rate below 26000 seem to complain as above. But with Uh - 26 megabits/sec is much too high. THat's almost 3x the limit allowed for the DVD format. > sector=00001725 > **ERROR: [mplex] Need to split output but there > appears to be no %d in the filename pattern final.mpeg > When I tried with %d in command line filename, for a That problem was fixed some time ago - for the DVD format the length is unlimited (you should never see that "need to split" message). I thought the fix was in 1.6.2 but perhaps not. Try leaving the bitrates at the defaults, make sure the input stream into the encoder is correct (aspect, framesize) and I think things will work much better. Good Luck! Cheers, Steven Schultz ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ Mjpeg-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mjpeg-users