On Thu, 23 Dec 2004, Roger Ivie wrote:
On Thu, 23 Dec 2004, [iso-8859-1] Pedro Hernansáez wrote: > mplayer -vo yuv4mpeg -ao null divx.avi & > nice -10 mpeg2enc -f 8 | yuvscaler -O DVD | -o video.mpg < stream.yuv > > but this gime a error with yuvscaler.................
But you're not going to tell us what the error is.
I was going to say the same thing :) Seeing the actual log messages from the commands would have been very helpful.
I'm willing to bet it's "cannot determine standard" or whatever the wording is because yuvscaler can't tell whether -O DVD means a PAL or NTSC DVD and you need to use:
yuvscaler -n p -O DVD
Be careful though. If you get something like Divx in an AVI container the video has almost certainly been mangled (thru cropping and/or scaling) into an exact 4/3 image using _square_ pixels.
To properly resample (scale) the data and preserve the aspect ratio it is necessary to take into account the 1:1 input SAR (Sample Aspect Ratio) and the target SAR. For 625line ("PAL") systems the SAR is 59:54 (for 525line, "NTSC", it's 10:11).
It should never be necessary to arbitrarily give "-n p" or "-n n" - if the stream has the proper attributes the encoder will be able to
do the Right Thing.
Use 'y4mscaler' (not part of mjpegtools - you can get y4mscaler from http://www.mir.com/DMG/Software/y4mscaler.html , use 0.6.2 if you're
using mjpegtools 1.6.2, use 0.7.1 if you're running the cvs version
of mjpegtools) thus:
... | y4mscaler -I sar=1:1 -O sar=59:54 -O preset=DVD -S option=sinc:4 | ...
Actually I'd use something like:
y4mscaler -I sar=1:1 -O sar=59:54 -O size=704x576 -S option=sinc:4
because 704xN is the full frame (and is a valid DVD size). DV and DVD frames are 720xN but they've captured an extra 8 pixels on each side (which you don't see on a TV set anyhow due to overscan). But if you require 720xN then go ahead and specify that - the scaler will do the right thing (likely with padding an extra 8 pixels on each side ;))
y4mscaler will pad/crop as needed to carry out the specified operation.
As a real life example here's the scaling step I use to downscale HDTV to widescreen DVD format:
y4mscaler -I active=1920x1080+0+0 -O infer=exact -O sar=40:33 -O size=704x480 \
-S option=sinc:6
The input stream was encoded as 1920x1088 with the MPEG-2 "VDS" (vertical display size) set to 1080 thus I tell the scaling to only
pay attention to the first 1080 lines and then target widescreen
(40:33 for "NTSC") 704x480. PERFECT match and comes out looking
great.
Good Luck!
Cheers, Steven Schultz
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Mjpeg-users mailing list Mjpeg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mjpeg-users