On Sat, 17 Jul 2004, Glenn Morse wrote: > Hello, I'm having some trouble with mpeg2enc giving me an error I don't > understand...
> glenn DVD $ jpeg2yuv -n 50 -I p -f 29.97 -j tmp/out-1.jpg | mpeg2enc -n > n -f 8 -o tmp/background.m2v ... > INFO: [jpeg2yuv] Processing non-interlaced/interleaved > tmp/out-1.jpg, size 14221l. > INFO: [mpeg2enc] Selecting DVD output profile > ++ WARN: [mpeg2enc] No aspect ratio specifed and no guess possible: > assuming 4:3 display aspect! > INFO: [mpeg2enc] Progressive input - selecting progressive encoding. > INFO: [mpeg2enc] Encoding MPEG-2 video to tmp/background.m2v > INFO: [mpeg2enc] Horizontal size: 720 pel > INFO: [mpeg2enc] Vertical size: 576 pel > INFO: [mpeg2enc] Aspect ratio code: 2 = 4:3 display > INFO: [mpeg2enc] Frame rate code: 4 = 30000.0/1001.0 (NTSC VIDEO) > INFO: [mpeg2enc] Bitrate: 7500 KBit/s > **ERROR: [mpeg2enc] Sample rate is greater than permitted in specified Level > > What exactly does "Sample rate is greater than permitted in specified > level" mean? How can I correct this? It means a couple things. One thing is that the error message is slightly phrased - it should have said "frame size" instead of "sample rate". But mostly it means you specified NTSC (the "-n n") to mpeg2enc but then went and fed as input a PAL frame size. For NTSC the maximum framesize for [EMAIL PROTECTED] (Main Profile @ Mail Level) is 720x480. Thus 720x576 is out of range. Why did you create a 720x576 image instead of a 720x540? 720/540 is a 4:3 image where 720x576 is not. Or are you in a PAL country? The other (warning) error is also a clue that things are not set up right for what you're trying to do. The message "No aspect ratio specified ..." means that 'jpeg2yuv' is generating a sample aspect ('A') tag of 0:0 meaning unknown. If you do something like this: jpeg2yuv -n 50 -I p -f 29.97 -j file.jpg | head -n 1 I wager you will see something like this: YUV4MPEG2 W720 H576 F30000:1001 Ip A0:0 C420jpeg mpeg2enc uses the framesize and sample aspect ratio (SAR) to try and figure out the display aspect ratio (DAR). A0:0 means "unknown" and that is what mpeg2enc is warning about before defaulting to 4:3 for the DAR. Arguably jpeg2yuv should use "A1:1" since computer generated graphics are often/mostly square pixels. What you need to do is resample/scale the data to 720x480 Rec.601 pixels which for NTSC have an aspect of 10:11. y4mscaler (http://www.mir.com/DMG/Software/y4mscaler.html) will do that extremely accurately. Oh. while you are doing that it's probably also a good idea to convert the chroma from 420JPEG to 420MPEG2. Again, y4mscaler to the rescue! Something like this should do the job: jpeg2yuv ... | \ y4mscaler -I sar=1:1 -O sar=10:11 -O size=720x480 -O chromass=420_mpeg2 | \ mpeg2enc ... Actually that's probably not exactly right for a 720x576 image. If you're doing computer generated graphics for encoding you generate them at the intended Display Aspect (4:3 or 16:9). For NTSC that works out to 720x540 and 854x480 respectively. Then you scale the image to the DVD frame size of 720x480. Have fun! Cheers, Steven Schultz ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ Mjpeg-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mjpeg-users