PDA

View Full Version : High Quality TY/MPG to AVI Conversion?



misato
06-28-2005, 10:26 PM
We all know that MPG files generated by the usual extraction methods "aren't exactly kosher MPEG", but most DVD players (as well as my Sigma Designs DVD cards) like those files well enough. When all we need to do is GOP editing (or recently frame accurate in tytool, I gather), to make DVDs that play in most players, that's good enough.

But some of my captured files need more elaborate editing (eg fixing up the audio, blacking out rain fade breakups, etc) which can really only be done in a conventional AVI editor. So it would be very nice to be able to convert extracted MPG to editable AVI with little or no loss. I have yet to accomplish this, and I'm hoping someone can offer some suggestion(s).

Here's what I can and can't do:

I use a sigma designs DVD card to a regular TV as my usual playback device. This seems to behave like most DVD players in terms of what it does and doesn't like, which makes sense as it uses a hardware codec.

If I do an analog DV capture from the Tivo, edit, and recompress to MPEG, the results are essentially perfect, but between realtime capture and re-encoding, it's slow. I'd like to do things quicker and just as well by extraction.

If I use TyTools to get and remux a ty to mpg, that plays perfectly, both on the PC and on the sigma designs card.

Likewise if I use mfs_ftp to export a ty file and then tystudio to make an mpg, that too plays perfectly on pc and on the sigma card.

But with every tool and setting I've tried, either a tytools or mfs_ftp/tystudio mpg file converts rather poorly to AVI. This is a bit hard to understand, since the sigma card is generating visually perfect video in real time: surely we should be able to do as well inside a pc?

I've been using as my test clip a bit of fox news, as the text crawl across the bottom of the screen exposes grossly the problems with extraction-based methods: I get jagged, jittery text in place of the smothly moving, well rendered original text. I fully expect that it's interlacing that's somehow the culprit, but no setting I've tried with any tool has really worked very well.

So to summarize, if I do analog capture to generate an editable DV AVI, that can be mpeg-encoded to smooth, perfect video.

If I use either of the extraction-based methods, either tystudio based or tytool based, the editable video has horrible (interlace-related?) artifacts that show up extremely well when text crawl is in the test clip (but also leads to jumpy horizontal motion generally too).

I've tried using a general purpose editor (no dice: video freezes), virtualdubmod (not *too* bad in deinterlace, but still degraded), MPEG Mediator (about the same as the best result I've gotten from virtualdubmod), and several standalone video format converters. Every last thing I've tried has produced a result ranging from hideous to so-so, when tested on challenging video. (Talking heads look okay, since they have little lateral motion, and what there is is slow).

Can anyone suggest a way I've missed, to convert extracted mpg to smooth-motion, nonjaggy AVI?

Thanks!

skellum
12-15-2005, 06:56 PM
BUMP

No takers on this one? With the ipod video all over the place, i woudl think this would get smoe airtime.

google brought me here while searching for info on converty .ty into AVI. QuickTimePro exports AVI to ipod video format, so the big question is how to get good AVIs out of tystudio.

cheer
12-15-2005, 08:26 PM
Well, understand that "AVI" is just a container. So the real question is, what codec are you using?

If you truly want editable AVIs without loss, use the HuffyAV codec. But be prepared for big files.

Otherwise, anything you do is going to degrade quality because you're recompressing.

The next question would be, what is your final destination? If it's for playback on a TV, don't deinterlace -- you're only going to reinterlace on playback (unless you have a digital TV). If it's for playback on a PC or some other progressive device...well, nothing is perfect. The best results I've seen have been using Avisynth with a bob&weave decomb filter, but it's never going to be perfect. Understand that you're taking 60 fields of information and trying to cram them into 30 frames.

Now if the source was originally a film source, you can inverse telecine it, but if it wasn't originally film it will look awful.

From an editing perspective, you may find it simpler to use a more advanced MPEG editor like VideoReDo. It has an awful lot of features, and the beauty is you don't re-encode the video (except where you make changes, of course).

If you just want to turn them into Divx/Xvid...well for that I just use AutoGK. Works about as well as anything else.

One more note: even if you have a digital TV, it still may be best to leave the video interlaced. My plasma does a far better job of decombing than any of the software stuff I've tried.

skellum
12-15-2005, 10:19 PM
ok, so now that i feel like a TOTAL newb, i dont understand half of the terms mentioned, even though i've spent a fair amount of time reading the newb docs on doom9.

all i know is that the final video, that plays on the ipod is 320x240 m4v (mpeg-4).

i was assuming that a full screen tivo image wouldn't be to lossy when droped down to that size, but from what i'm reading (assuming i'm understanding any of it), the avi you make from the ty file will be munged up enough that even at 320x240 your quality will still be bad?

most of my ty files are about 1g, and the drive i work on usualy has 100g free, so size doesnt' matter since the avi would be deleted after converted to m4v.

i'm starting to think buying quicktime pro wasn't as much of a solution as i thought it would be. even with the pro version, i still need a way to make the avi.

is doom9 the place i should be looking for this kinda stuff, or are there better resources?

thanks,

- skellum

artships
12-16-2005, 11:05 AM
I take it this thread (http://www.dealdatabase.com/forum/showthread.php?t=45933) does not help you?

lgkahn
12-16-2005, 01:17 PM
use tytools convert to .mpg and then I use dvdx to convert to standard avi's but it takes a long time...

skellum
12-16-2005, 01:33 PM
I take it this thread (http://www.dealdatabase.com/forum/showthread.php?t=45933) does not help you?

oddly enough, i had read that thread and tried those steps befoer ending up in this thread. i couldn't get nero to read the mpeg (dvdx is reading it as i type this message). but i did try that. maybe i'm selecting the wrong options when i have tystudio "process" the .ty file.

sidenote: i got desperate and tried using the avi output of deset Pocket Video Maker (palm edition), and as expected, the avi's could not be read by quicktime. if this dvdx to avi thing pans out, i'll be a happy camper.

cheer
12-16-2005, 06:19 PM
ok, so now that i feel like a TOTAL newb, i dont understand half of the terms mentioned, even though i've spent a fair amount of time reading the newb docs on doom9.

all i know is that the final video, that plays on the ipod is 320x240 m4v (mpeg-4).

i was assuming that a full screen tivo image wouldn't be to lossy when droped down to that size, but from what i'm reading (assuming i'm understanding any of it), the avi you make from the ty file will be munged up enough that even at 320x240 your quality will still be bad?
It should not be bad. But keep in mind that ANY time you change resolutions, codecs, etc., you're re-encoding the video. Any time you re-encode the video using a lossy method (MPEG 1/2/4, etc.), you will degrade quality.

More than likely your problem is an interlacing problem. The iPod is a progressive device. So, somehow, you need to decomb/deinterlace the file.

I'm not familiar with the tools available for converting to the iPod (don't have one). I do know that you can use Avisynth; there are some decent Avisynth plugins for decombing. But using Avisynth manually is not for the newbie.

i'm starting to think buying quicktime pro wasn't as much of a solution as i thought it would be. even with the pro version, i still need a way to make the avi.
Not sure what Quicktime Pro is for, unless it's a quicktime codec that the video has to end up with. Remember again, there is no such thing as a "standard" AVI. AVI is not a video format; it's a container. AVI files can be uncompressed, or compressed with any number of different codecs.

So is the iPod looking for an AVI container, or a Quicktime .mov-type file?

is doom9 the place i should be looking for this kinda stuff, or are there better resources?
Doom9 is a great place for this stuff -- the best I am aware of.

cheer
12-16-2005, 06:21 PM
use tytools convert to .mpg and then I use dvdx to convert to standard avi's but it takes a long time...
Does dvdx make iPod-compliant files? (I know the original poster was asking about editable AVIs, but skellum was asking about iPod videos.)

And FYI, there's no such thing as a "standard" AVI. AVI is a container, not a format.

skellum
12-16-2005, 07:15 PM
Does dvdx make iPod-compliant files? (I know the original poster was asking about editable AVIs, but skellum was asking about iPod videos.)

And FYI, there's no such thing as a "standard" AVI. AVI is a container, not a format.

Anything that QuickTime Pro can play, can be exported to iPod Video. Upgrading to Pro adds an "export" option to the file menu. There are a multitude of formats available in the resulting dialog box. For iPod Video purposes, one of those is the 320x240 m4v (some form of MPEG-4)

Since the other files i've converted were AVI, I assumed that AVI would be an OK starting point for getting shows from my Tivo to my iPod.

QuickTime seems to read the AVI files (i selected Cinepak in the DVDx menu), but i've had a few crashes/lockups during the "export" process. This might be resource related (P4/1.4Ghz/256M ram).

I'm thinking I may need to find Solaris tools for the conversions and utilize the UltraSparcIIIi/1G ram instead.

rc3105
12-16-2005, 08:22 PM
ok, so now that i feel like a TOTAL newb, i dont understand half of the terms mentioned, even though i've spent a fair amount of time reading the newb docs on doom9.

...

most of my ty files are about 1g, and the drive i work on usualy has 100g free, so size doesnt' matter since the avi would be deleted after converted to m4v.

is doom9 the place i should be looking for this kinda stuff, or are there better resources?

thanks,

- skellum
quick & dirty conversion for portable viewing try

mencoder whatever.ty -o whatever.avi -demuxer 33 -vf scale=320:240 -mc 0 -ss 0.1 -oac lavc -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=200:autoaspect:trell:acodec=mp3:keyint=30:turbo -ffourcc DIVX


-----

or open the proverbial can of worms


ty or mpeg, what matters most when converting to another format like mp4 is how well the initial codec is able to read tivo flavored mpeg

there's an open source media player called (oddly enough) mplayer (http://www.mplayerhq.hu) that does a fair job of reading ty directly. it includes a util called mencoder that uses any supported codec to decompress & then recompress into whatever format is selected. for example

mencoder whatever.ty -o whatever_huffyuv.avi -demuxer 33 -ss 0.1 -oac lavc -ovc lavc -lavcopts vcodec=huffyuv:format=422p:vhq:trell:turbo:acodec=mp3

or

mencoder whatever.ty -o whatever_huffyuv.avi -vf scale=320:240 -demuxer 33 -ss 0.1 -oac lavc -ovc lavc -lavcopts vcodec=huffyuv:format=422p:vhq:trell:turbo:acodec=mp3


transcodes into huffyuv, theoretically w/o any quality loss. huffyuv is a lossless codec that preserves image quality at the expense of huge files. (that's ok as they're only temporary and not nearly as large as uncompressed video.) the second option shrinks video to 320*240 during the initial conversion

*-ss 0.1 - means jump .1 second into the file before beginning, seems to maintain a/v sync on problematic files


you can edit the huffyuv file in virtualdub until it's just right (using the audio/video direct stream conversion setting = no quality loss) then either change the video setting to full processing or use mencoder again to transcode to xvid


mencoder whatever_huffyuv.avi /dev/null -mc 0 -ss 0.1 -oac lavc -ovc lavc -lavcopts vcodec=mpeg4:vhq:vpass=1:vbitrate=800:autoaspect:trell:acodec=mp3:keyint=30:turbo -ffourcc DIVX

first pass analysis to optomize second pass encoding

mencoder whatever_huffyuv.avi -o whatever.avi -mc 0 -ss 0.1 -oac lavc -ovc lavc -lavcopts vcodec=mpeg4:vhq:vpass=2:vbitrate=800:autoaspect:trell:acodec=mp3:keyint=30:turbo -ffourcc DIVX

change vbitrate=800 to adjust total filesize/quality

cheer
12-17-2005, 01:45 AM
Anything that QuickTime Pro can play, can be exported to iPod Video. Upgrading to Pro adds an "export" option to the file menu. There are a multitude of formats available in the resulting dialog box. For iPod Video purposes, one of those is the 320x240 m4v (some form of MPEG-4)

Since the other files i've converted were AVI, I assumed that AVI would be an OK starting point for getting shows from my Tivo to my iPod.
That's probably one more step than necessary. Since the files come from the Tivo as MPEG2, and your destination is iPod video/MPEG4, it seems a waste to convert the MPEG2 to an AVI of indeterminate type and then run through QuickTime Pro again -- and it probably degrades the quality further.

If you don't want to do something as manual as Avisynth, try Gordian Knot. Not quite as automated as AutoGK, but you can fiddle more with the settings. GK can deinterlace your source, reduce it in size, and transcode it to MPEG4 in one go. (Heck, if your video is letterboxed it can even crop the letterboxing out...)

cheer
12-17-2005, 02:01 AM
quick & dirty conversion for portable viewing try

mencoder whatever.ty -o whatever.avi -demuxer 33 -vf scale=320:240 -mc 0 -ss 0.1 -oac lavc -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=200:autoaspect:trell:acodec=mp3:keyint=30:turbo -ffourcc DIVX
OK well I am not very familiar with mencoder, but looking at this...are you doing any decombing/deinterlacing? Most (in fact, all SD, I would assume) ty files are interlaced. The iPod is a progressive device -- does it handle decombing on its own? Otherwise I'd expect the output of above to exhibit the "sawtooth" effect.

(My plasma TV does decombing very nicely. On the other hand, my laptop doesn't do it at all using std. WMP. But for that I just use Media Player Classic with ffmpeg's deinterlacing, and it looks...well, about as well as deinterlacing usually does.)

ty or mpeg, what matters most when converting to another format like mp4 is how well the initial codec is able to read tivo flavored mpeg
Mmm. I've certainly seen some things choke on my DTivo .ty files. Open GOPs, very long GOPs, reversal of the field order...bleargh. Toss some rain faid in there and you never know what you'll get.

For the most part, though, if I process from .ty into .mpg using either TyProcess or TyTool, I can then do whatever I want without issue. But if mencoder can do it straight from the .ty then maybe I will play with it.

rc3105
12-17-2005, 09:54 PM
the Mplayer documentation (http://www.mplayerhq.hu/DOCS/HTML-single/en/MPlayer.html) has several sections & examples that deal with Encoding interlaced video (http://www.mplayerhq.hu/DOCS/HTML-single/en/MPlayer.html#menc-feat-dvd-mpeg4-encoding-interlaced)

doom9 (http://www.doom9.org/) and the doom9 forum (http://forum.doom9.org/) have extensive info & links re advanced video processing. odds are somebody's posted optimal encoder settings for ipod playback in the forums

don't watch video via ipod myself, got a digital camera which works nicely for that :D

skellum
12-19-2005, 03:18 PM
don't watch video via ipod myself, got a digital camera which works nicely for that :D

the main advantage to my ipod, is that i always have it around. so if i'm stuck waiting somewhere for something, i can pop it out and catch up on whatever. i've never tried to watch movise on my digital camera before (except for the ones i record on it).

i have a bad feeling i'll be able to catch up on the entire season of battlestar galactica while in the return line this christmas... ;-)

rc3105
12-19-2005, 07:12 PM
the main advantage to my ipod, is that i always have it around.
that's the way it is with my camera, never leave home without it. movies & music was a nice bonus (one less gadget to lug around) that'll be on the must-have features list when I go shopping for a 6+ megapixel