[mythtv-users] Partly OT: Converting HD content in MPEG2-TS to DVD compliant MPEG2

Steven Adeff adeffs.mythtv at gmail.com
Tue Mar 14 05:23:55 UTC 2006


On 3/12/06, casey dunn <casey.dunn at gmail.com> wrote:
> On 3/12/06, Steven Adeff <adeffs.mythtv at gmail.com> wrote:
> >
>  On 3/12/06, casey dunn <casey.dunn at gmail.com> wrote:
> > On 3/9/06, Steven Adeff < adeffs.mythtv at gmail.com> wrote:
>  > > > Any help/pointers are appreciated.
> > >
> > > I use mencoder, its more of a hassle but since its time based and not
> > > frame based (like avidemux, or I might have this backwards, I
>  > > forget...) it works much better. You have to manually setup the
> > > filtering etc. depending on your source, though for the most part
> > > 1080i is all the same and 720p is all the same, so that makes it easy,
> > > I've created scripts for the encodes I do (many "hr.hdtv" and some
> > > 1080p or 720p encodes).
> > >
> > > The mencoder online manual talks about encoding to DVD so start there.
> > > http://www.mplayerhq.hu
> > >
> >
> > Care to share you're scripts?  I'm having some trouble getting my hidef
> > captures shrunk down to a more wireless friendly size while keeping them
> in
> > an mpeg container.
>
>> My scripts are designed for my specific needs, I can create mencoder
>> command lines if you tell me the requirements you have for the output
>> files (video format, file size, resolution, audio format, etc).
>
> My target is mpeg files I can stream over 802.11b, my source is OTA DVB
> atsc.  Something around SVCD quality should be fine.  I'd like to autocrop
> (many but, not all 4:3 programs are broadcast with black bars), Keep the
> proper aspect when croping isn't needed, included the new aspect ratio when
> it is, downsample audio to stereo.  It would be sweet if the audio could be
> handled the same as autocrop; not everything is 5.1 ac3 quite a few are 2ch
> allready.
>
>  ffmpeg -target svcd is pretty close to what I want.  It's always
> re-encoding the audio, which I don't need or want (I belive all my target
> devices can handle ac3 stereo), I haven't found an autocrop for it yet, and
> it's seems to be a bit too much for one of my frontends.
>

here are the options you'll want to use. I've seperated different
areas depending on input...

First, for true HD shows...
Filtering-
for 1080i,
-vf pullup,softskip,scale=480:480 -ofps 24000/1001

for 720p,
-vf decimate=2:1000:1600:.001,scale=480:480 -ofps 24000/1001

for 4:3 content within 16:9,
for 1080i,
-vf pullup,softskip,crop=1424:1072:248:4,scale=480:480 -ofps 24000/1001

for 720p,
-vf decimate=2:1000:1600:.001,crop=1424:1072:248:4,scale=480:480 -ofps
24000/1001

Note: these are general, many stations are starting to use
non-standard or alternate methods for frame progressions within their
mpeg streams so your exact frame reduction method may need to change
or you may need to do a straight frame-by-frame encode.
Also, for cropping, different stations treat 4:3 content within 16:9
differently so you may have to play around with the crop values to
find the ones that work best, you want the general shape of the final
output area to be near 4:3 though, the further off the weirder it will
look.

The rest of the options you'll want,
for 16:9
-lavcopts vcodec=mpeg2video:aspect=16/9:vrc_buf_size=917:vrc_maxrate=2500:vbitrate=1800:keyint=15:trell:mbd=2

for 4:3
-lavcopts vcodec=mpeg2video:aspect=4/3:vrc_buf_size=917:vrc_maxrate=2500:vbitrate=1800:keyint=15:trell:mbd=2

Note: these are basically the SVCD specs with trell and mbd=2 added to
try and improve quality. These will slow down the encode speed and may
not increase quality any, so you may want to try with and without to
see if having them is worth it for you.

-ovc lavc
-oac copy
-of mpeg
-mpegopts format=xsvcd
-o outputfile.mpg

Note: this will keep the audio stream from your source, since it
sounds like thats what you want.

let me know if u have any questions...

--
Steve


More information about the mythtv-users mailing list