On Tue, 24 May 2005, Jean Connelly wrote:

> I've looked around in the archives, but much to my surprise, I haven't
> seen a good howto on this.  I've got a firewire-captured TS stream

        Hmmm, I know I've posted (moderately extensively) on the subject 
        in the past.  But then perhaps the mjpegtools archives aren't 
        easily searchable.

> from my cable box.  I'm using mplayer to generate a yuv stream and
> then I'm scaling it with y4mscaler.  Are there any recommendations or

        Hmmm, I prefer to use ProjectX and mpeg2dec.  ProjectX not only 
        demuxes the TS stream into elementary files (.m2v and .ac3) but also
        repair damaged areas (lost or error TS packets) without losing A/V
        sync. Oh, also ProjectX can be used to cut out the commercials before
        demuxing.

        Then mpeg2dec decodes the .m2v file into a format understood
        by a utility in mjpegtools.

        ProjectX 
        --------
http://www.lucike.info/index.htm?http://www.lucike.info/page_projectx.htm

        mpeg2dec (the project is libmpeg2)
        ----------------------------------
http://libmpeg2.sourceforge.net/

> options for either yuvscaler or y4mscaler to scale this to dvd
> resolution in a nice way?

        Now that is something should be in the archives.  I'll  append a
        snippet of the script I use below. 

> I'm just working from the info in the tools and I'm a bit confused:
> mplayer says that it is just 1920x1080 @ 29.970.  It looks like

        It's _actually_ 1920x1088 with the MPEG-2 vertical display size set
        to 1080.  Why?  That's because MPEG encoders really want sizes to
        be a multiple of 16 and 1080 does not qualify.

> interlaced content to me; should I deinterlace or will the sampling
> algorithms of y4mscaler or yuvscaler end up doing the right thing?

        If it's from TV it's interlaced :)  I NEVER deinterlace during the
        encoding process - that's a lossy process and you'll never get the
        detail back.  Instead deinterlace at _playback_ time using the
        deinterlacing capabilities of the player software and/or hardware.
        Don't confuse deinterlacing with 2:3 pulldown reversal.  If you know
        that the source of the data was originally done on film then you might
        have some success with a reverse telecine process - but you run the
        risk there of video and film sequences being intermingled and that will
        cause problems.

--------------------cut here----------------
#!/bin/sh

N=input

# Since a full frame is 704x480 (NOT 720x480!) exact scaling with
# NO cropping/padding can be done by explicitly setting the SAR to 40:33 and 
# the output size to 704x480!

mpeg2dec -o pgmpipe $N.m2v | \
  pgmtoy4m -i t -a 1:1 -r 30000:1001 -x 420mpeg2 | \
  y4mscaler -v 0 -I active=1920x1080+0+0 -O infer=exact -O sar=40:33 -O 
size=704x480 -S option=sinc:6 | \
  mpeg2enc -f 8 -b 7500 -r 24 -q 3 -D 10 -E -12 -K tmpgenc -4 1 -2 1 -o out.m2v
-----------------------------------------------

        The 'pgmtoy4m' program (part of mjpegtools) does NO "conversion" of the
        data, it just repackages/rearranges the bytes from mpeg2dec's PGM format
        into YUV4MPEG (4:2:0planar).

        The above produces what I think are excellent looking DVDs.

        Cheers,
        Steven Schultz



-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to