Log in

View Full Version : Convert Interlaced SD Video_ts content to Progressive MKV


techLife
11th September 2011, 03:42
As the title implies, I would like to convert some SD interlaced content to progressive MKV.

When I first started archiving my collection to my server, everything was ripped from disc to video_ts to maintain the original quality. I have since been made a believer of MKV and it solved my forced subtitle woes. I have been using MakeMKV to do this. All of this works great but I still have one issue...

I am currently using XBMC on my Windows based HTPC and also on a couple AppleTVs for playback of my SD content. On content that is progressive, all is fine. Interlaced however looks terrible. I *believe* they are using bob to deinterlace and I *believe* this is the problem. Here is a pic of what I am encountering in scenes that have any quick motion in them: http://scrnsht.com/oopmht. AFAIK, there is no way to change the deinterlace method.

So, my noob logic dictates that if I were able to convert the file to progressive using Yadif 2x and put it in a MKV container my issues would be gone.

I have been hunting this forum and the net for a guide to do this and can't find anything definitive. The key here is that I want to do this without any loss. I know that DVD is already lossy so I would prefer not to lose any more.

Does anyone know of an idiots guide that can help me do this? Or at least point me in the right direction?? Is it even possible??

I really need to get this fixed before I pull the rest of my hair out.

Thanks in advance!!

manono
11th September 2011, 15:19
Welcome to the forum,

I *believe* they are using bob to deinterlace and I *believe* this is the problem.

That's not a picture of a bob deinterlace (which takes each field and expands it into a full frame, doubling the framerate) but a blend deinterlace (which blends the two fields comprising a frame and keeps the original framerate). Unless the source is a field-blended PAL2NTSC conversion, but that's not too likely.
The key here is that I want to do this without any loss.
Not a chance. Wouldn't you agree that the blend deinterlace caused a loss? Yadif is way better but any deinterlacing (not to mention the reencoding itself) causes loss.

If you want to do this manually, it's time to learn some AviSynth. If you'd like the help of a GUI, I might recommend XviD4PSP, The name is misleading and you can fairly easily create MKVs with H.264 or x264 video and also choose from among Yadif or several other deinterlacers. That assumes it needs to be deinterlaced. If from a film source it might need only an IVTC. A small sample might be useful here. Anyway, you can find XviD4PSP along with guides for its use here:

http://www.videohelp.com/tools/XviD4PSP

There are other ways to accomplish what you want and maybe others will have suggestions.

techLife
11th September 2011, 17:07
I would be happy to post a sample but I don't know how to do this from a video_ts folder.

The pic that I posted is from an episode of Criminal Minds season 5. We primarily watch TV episodes ripped from the discs. Most are progressive and look fine. Occasionally, a certain season of a series will show up as interlaced when inspected with MediaInfo. (NCIS does this too). These are the seasons I have issues with. It would be great if I could just IVTC and be done with it. I have an idea of what inverse telecine is but have no idea of how to do it. Is there a program (gui) you would recommend I use to try this?

I just downloaded XviD4PSP and am going to play with it today.

EDIT: For my first try, I selected deinterlace, x264 lossless, audio copy. 4 hours on my Core i7 w/ SSD & 8GB RAM? Wow!! This is going take months... Oh well, as long as it works, so be it.

At the end of the day, I just want it to look and sound the absolute best possible given what I have to work with from the disc. It certainly looks terrible now just I guess it can only get better right? ;)

Thanks for the help, I really appreciate it!!

manono
11th September 2011, 17:32
You can figure out yourself if it needs an IVTC or a deinterlace. Scroll to a place with movement in something that won't deinterlace it (VDubMod and many players with the deinterlacers turned off). If, when you advance a frame at a time, every frame is interlaced, it needs to be deinterlaced. If two frames in every five frame cycle is interlaced and the other three are progressive, an IVTC is that you need. I think your show is probably sourced from film and needs an IVTC. XviD4PSP has an IVTC choice. I think it's listed among the deinterlacers.

As for a sample, open a VOB in DGIndex, use the [ and ] buttons to isolate a small piece, and then File->Save Project and Demux Video. Upload the resulting M2V to some filesharing site such as Sendspace or MediaFire and give us the link.

techLife
11th September 2011, 18:44
TYVM

With any luck, I am doing this right: http://ScrnSht.com/ceumkm

And here is a sample: http://www.mediafire.com/?idvibkc94my2i6x

EDIT: Something is definitely wrong...at about 50% the temp file is already up to 2.5GB. I'm not saying size is that much of a concern, but 5GB an episode is ridiculous. >.<

Didée
11th September 2011, 19:57
That filesize is no mystery, since you're using *lossless* encoding ("--qp 0"). That guarantees huge filesizes. You rather want to use CRF encoding, in range --crf 16 to --crf 24.

Your filtering is wrong, too. That source is not "simply interlaced", instead it used standard 3:2 field pulldown (aka "telecine"). For that, you need to perform IVTC (inverse telecine):

LoadPlugin("path/to/TIVTC.dll")

Mpeg2source("path/to/source.d2v")
TFM()
TDecimate()

which will produce 23.976fps FILM.

techLife
11th September 2011, 20:04
I assume this is using AviSynth from the command line and not in XviD4PSP? Or is this under the AviSynth menu IN Xvid2PSP?

Would you mind posting an idiots guide for me this one time so I can see how you did it and learn from it?

THANKS! (And thanks for the quick responses as I am trying to do this right now.)

EDIT: In the screenshot above, I was using v5 of XviD4PSP. It was brought to my attention that I should be using v6.04b which I am now. :)

Didée
11th September 2011, 20:40
Well, have a look in the MPEG-4 Encoder GUIs (http://forum.doom9.org/forumdisplay.php?f=78) section. People are using MeGUI, StaxRip, HDConvertToX, and whatnotelse. Alas I'm not the right person to help you (much) in this respect ... there are "thousands of" different encoding GUIs that people are using. Me, personally, I hardly ever use any of them. I'm rather a "do it manually" guy. ;)

techLife
11th September 2011, 21:04
I will have a look. Thanks.

At this point, I'm not married to anything and I really don't care how I do it as long as it works. ;)

I am happy to learn the manual way. Is this with AviSynth?

I guess what I am asking is if you wouldn't mind posting a step-by-step guide of how YOU would do it so that I can see & learn for myself.

THANKS!!

EDIT: If anyone is familiar with XviD4PSP, please take a look at this screenshot and tell me if I am on the right track now??? http://ScrnSht.com/wngvyf Please? =)

manono
12th September 2011, 09:01
Since it's telecined film, you don't want to deinterlace using Yadif. You want, in Video->Interlace/Framerate->Deinterlace->TIVTC, to IVTC it using the included IVTC called TIVTC. After selecting that you can check the script being used in AviSynth->Edit Filtering Script to make sure the line:

TFM(order=1).TDecimate()

is in the script. If there's a 'Hybrid=1' inside of TDecimate, remove it. Your other settings as shown in your picture look OK.