On Mon, 25 Apr 2005, Jean Carlos wrote: > the reason why i'm converting to letter box its because i don't know if > using mpeg2enc with -n n -F 4 -a 3 will give me a 16:9 dvd file with
After seeing the additional information you provided (thanks!) the input file does not have the proper attributes to create a 16:9 DVD file from. Initially I thought you had an anamorphic video or the producers had created the file at 848x480. > Yes u were right after checking the frame rate i realize that was in > 23.97, by the way here's the output: > > VIDEO: [XVID] 640x360 24bpp 23.976 fps 945.9 kbps (115.5 kbyte/s) Ah ha - I thought that was the case. So when you recoded with a forced rate of "-F 4" the video would run about 25% fast. > to reach the 30 fps seems to be i good idea to use a 3:2 pulldown, > thanks a lot i never would realize how to change the fps without having > the audio problem You encode as 24000/1001 with the 2:3 pulldown. On a progressive scan TV/DVD combination you have ~24 frames/sec each lasting 1/24'th of a second (basically the repeated fields are ignored). When that gets played on a non progressive setup the repeated fields are not ignored/discarded and so you have ~30 frames/sec with each frame lasting 1/30'th of a second. The end result in both cases is that you have 1 second of video. If that's too confusing then just think of it as "magic that works" :) > > cat stream.yuv | head -n 1 > here's the other output: > YUV4MPEG2 W640 H360 F23975999:1000000 Ip A0:0 > > obviously this is the first line of the yuv header but i dont know what > this means It means 0) you have a YUV4MPEG2 stream, 1) The Width is 640 pixels, 2) the Height is 360 lines, 3) It was produced by MPlayer which doesn't know to emit 24000:1001 instead of some weird floating point number, 4) It's progressive (most AVI files are), and 5) It has an unknown SAR (Sample Aspect Ratio of 0:0) - most naive video players do that it turns out (in practice it means the pixels are 1:1 or square). What is needed is to place the 640x360 image in a 640x480 frame with a black background. The resample/scale for 10:11 so we get a 704x480 DVD frame size. I think something like this: (decode the movie to YUV4MPEG2 as you were doing) | \ y4mscaler -I active=640x480+0+0cc -I sar=1:1 -O sar=10:11 -O size=704x480 -S option=sinc:7 | \ mpeg2enc -f 8 -p -c -q 4 -E -10 -D 10 -4 1 -2 1 -o output.m2v That will produce a full frame (704x480) letterboxed DVD compliant MPEG-2 output file. In case you're curious where 704 comes from the hint is in the "10:11" SAR and the fact that 640*11/10 is, well you get the idea :) > Probably i'm asking too much but if i would like to do a pal compilant, > how i would do it from ntsc and telecine sources? In general it's not possible to do a perfect job. To do that you'd need to go from 24000/1001 to 25 frames/sec and then speed up the audio by a similar amount. If there's a lot of music speeding up the audio by ~4% drives some musicians nuts ;) Getting the frame size correct for the video is trivial - just change the 480 to 576. You will end up with window box bars in addition to the letterbox ones - that can't be avoided with the dimensions of the input video. You can adjust the frame rate with 'yuvfps'. Dealing with the audio and then getting A/V sync perfect is something you'll have to experiment with :) 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://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Mjpeg-users mailing list Mjpeg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mjpeg-users