On Fri, 20 Aug 2004, Dik Takken wrote:
> I'm having difficulties generating interlaced MPEG2 streams from images. I
Most of the time people are interested in _de_interlacing ;)
> png2yuv -j Frame%d.png -b 1 -f 25 | mpeg2enc -f 3 -b 9000 -a 3 -o Video.m2v
> I am trying to combine two subsequent images into one interlaced frame.
> So, each input image is actually a single field, every 50 input images
> generate 1 second of 25 fps film.
Hmmm, computer graphics pixels are square, PAL pixels are 59:54. So
if you're simply creating 720x576 frames there's a good chance the
aspect ratio will be wrong on a TV set when then video is played back.
I'd generate 768x576 images and then put in a 'y4mscaler -I sar=1:1 -O
sar=PAL' before the encoder.
But be that as it may, let me see if I've understood what you're
doing:
Frame%d.png are full frame Nx576 images. From Frame1.png you want
lines 0, 2, 4, ... 574 and from Frame2.png you want lines 1, 3, 5, ...
In essence you're creating "50 frame/sec" worth of progressive image
frames and you want to convert that to 50 fields/sec (or 25 frames/sec).
The new frame is to be constructed from alternating lines from the
two input progressive frames.
Correct?
> Has anyone ever tried something like this?
Yes, I think I have had a need to do that. IF I have correctly
understood what you're doing then the utility 'y4minterlace' will
do exactly what you want. I needed that utility to convert 60000/1001
progressive HDTV (some TV stations in the US use 1280x720p @ 59.94fps)
to 30000/1001 interlaced for encoding on to a DVD.
What you do is use 'png2yuv' (or data generator of your choice ;))
and specify the rate as 50 for PAL (and 60000/1001 for NTSC) and
pipe the data thru 'y4minterlace'. The program takes alternating
lines from the first input frame and the second input frame and
writes out the interlaced frame.
Something like this:
png2yuv -j 'Frame%d.png' -I p -f 50 | \
y4minterlace -i t | \
...
y4minterlace will automatically divide the rate by two (since 2 frames
are being put together into 1 frame).
The '-i' option to y4minterlace allows you to specify the field
dominance. You can pick either '-i t' (top field first) or '-i b'
(bottom field first). If you are using DV sources for other parts
of the project you almost certainly want to use '-i b' so that your
generated portion matches the rest of the project.
Good Luck.
Cheers,
Steven Schultz
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users