PDA

View Full Version : Quickly Deinterlacing MPEG-2


drtj
26th October 2007, 20:57
I have an interlaced .ts with mpeg2 vid. I was wondering if there was any way I can use the original frames that I get after I use DGIndex and avisynth to deinterlace with this avisynth script:

mpeg2source("G:\1\2.d2v")
TFM()
Tdecimate()


Without any type of coding or changes to the frames, can I use the frames to make a vid file? It doesn’t matter if it is avi or mpeg. I am just looking for a quick way to deinterlace the mpeg2 file. As long as the file size is similar and not larger, I am okay with that.

I tried using direct stream copy in VDubMod, but the output files are 60 times the size of the original. I am not sure as to why. I guess maybe because the original file is an mpeg and VDubMod only outputs .avi?

Thanks.

neuron2
26th October 2007, 23:55
You got a giant file in VirtualDub because you did not use Video/Compression to select a compression for your output. If you don't, you get uncompressed RGB, which is HUGE.

The answer to your other question depends on whether the stream is pure interlaced, soft telecined, or hard telecined. If you don't know what those mean, you should start by finding out.

pure interlaced -- use a deinterlacer, modifies the frames

soft telecined -- use Force Film in DGIndex, or ignore pulldown in VirtualDub MPEG2, doesn't touch the frames

hard telecined -- use Telecide/Decimate or TFM/TDecimate, doesn't touch (most of) the frames.

drtj
27th October 2007, 01:02
It is captured HDTV from a STB. It is soft telecined for the most part. It follows the 3:2 pattern.

Basically what I want to do is just deinterlace the mpeg-2 video without changing the frames to save time rendering a file.

Let’s say I have say a 249 mpeg-2 mb file. I just want to deinterlace that file and get a file roughly the same size which should be relatively quick.

Like with that script in VDM, I get a good result and it takes care of the interlacing if I advance frame by frame. Can I just output those frames to a file and dub in the audio without processing / changing the frames?

For instance open the mpeg-2, correctly line up all the fields so the result = progressive and delete any duplicated frames (like I see in VDM), and output.

Even if I use the xvid codec and do a single pass with maximum quality selected the file size goes from 249 to 600 mb. Why? I would think that max quality = original frames, but the output file here is almost 3 time the size.

Like I said before .avi or .mpg doesn’t make a difference to me. I just want to quickly deinterlace my files and I figure to best way to do that is just use the original frames but with correct alignment and dropping some duplicated frames (deinterlaced).

Thanks for your reply and time.

neuron2
27th October 2007, 01:20
Let’s say I have say a 249 mpeg-2 mb file. I just want to deinterlace that file and get a file roughly the same size which should be relatively quick. You're showing that you don't understand what you're doing. You said it was soft telecined and now you say you want to deinterlace it. You don't; you need to apply inverse telecine (IVTC). I'll give you a method below.

Like with that script in VDM, I get a good result and it takes care of the interlacing if I advance frame by frame. Yes, but if it is soft telecined, you can achieve the desired result without the time consuming TFM/TDecimate() filtering. You need that only for hard telecined video. Again, you are showing that you don't understand the fundamentals.

Can I just output those frames to a file and dub in the audio without processing / changing the frames? No, because VirtualDub does not output MPEG2, and so you will have to re-encode to a different compression format.

Even if I use the xvid codec and do a single pass with maximum quality selected the file size goes from 249 to 600 mb. Why? I would think that max quality = original frames, but the output file here is almost 3 time the size. You are re-encoding, and you chose a too-high bitrate.

If it really is soft-telecined as you say, do it this way. Use DGIndex to open your file. Set Audio/Demux All Tracks. Then do Save Project and Demux Video. You'll get your audio and video elementary streams. Now open the M2V file in DGPulldown and select Custom 23.976 -> 23.976. Check Modify file in place and then hit Convert. Then remux the M2V and the demuxed audio using Imago Muxer to make an MPEG file. Voila, no processing of the video or audio. The whole process should take about 5-10 minutes.

It is soft telecined for the most part. For the most part? What is the rest and how much is there?

drtj
27th October 2007, 03:14
Yes, I was wrong and your right neuron2, I am not 100% when it comes to editing video like this. My apologies for my error and ignorance.

So I am reading about telecining, and I have concluded that it is not soft telecined at all. I know by 1) looking up definitions and 2) by following your directions and the result comes out not what I was hoping would come out. It comes out with the jagginess and saw toothing.

From what I read soft telecining is when a film / movie is put on a DVD “in its original progressive format, with special flags inserted into the MPEG-2 video stream.” That is not the case here. It is hard telecined… I think. To the best of my knowledge and going through the various webpages that help you identify your source video. It is definitely interlaced and follows the PPPII pattern (Progressive, P,P Interlaced, I) or 3:2pattern.

I am confident it is not pure interlaced.

I am getting closer to getting what I want though. So is there a way to take that demuxed video and deinterlace it quickly.

The method that you outlined took seconds to complete and it would be nice to have a similar method with deinterlacing thrown in there somewhere.

The reason I think this should work is because when I preview my clip in DGIndex it looks good and when I run the .avs through VDM it also looks good, and by that I mean it looks progressive. Both of these methods takes no time at all.

Just to be sure because again, I am not 100% with all the terminology and such, and even though I did research it, I have added some shortcuts to a small clip:
http://rapidshare.com/files/65453707/1.ts.html
http://www.bestsharing.com/files/8CseTd354829/1.ts.html

neuron2
27th October 2007, 03:39
Downloading... Will post back shortly.

neuron2
27th October 2007, 04:01
You have 1920x1080I HD video with hard 3:2 telecining. It's very easy to quickly strip the hard-pulled-down fields from this sample clip (i.e., to perform IVTC). Just play this script in anything:

mpeg2source("1.d2v")
assumetff()
DoubleWeave()
Pulldown(0,2)

If the pulldown phase changes, then you will need to segment the movie and apply one of these as appropriate for the phase:

Pulldown(1,3)
Pulldown(2,4)
Pulldown(0,3)
Pulldown(1,4)

The inconvenience of segmenting to handle phase changes is why filters like Telecide/Decimate and TFM/TDecimate exist.

But the real problem for you is to quickly create a rendered file without the pulldown. Because you have hard telecining, you have to re-encode. And re-encoding HD is very time consuming.

What is your goal? Just to watch it? Then just play an Avisynth script, or let your player deinterlace it as it plays. To make a rendered file? Then you have no quick solution.

The reason I think this should work is because when I preview my clip in DGIndex it looks good and when I run the .avs through VDM it also looks good, and by that I mean it looks progressive. Both of these methods takes no time at all. It looks good in DGIndex because the HD window is scaled by half, and scaling by half there is equivalent to discarding a field. It looks good in VDM because you applied IVTC in your script. But the problem is to create a *new rendered file* without the pulldown. You have to re-encode the HD MPEG2, and that takes a long time.

drtj
31st October 2007, 07:56
I am trying to render files and I was afraid that processing them was the only way to go. Thanks for the info.

What about a video file that is 100 % progressive but at 59.94 fps. Any easy and quick way to get that down to 23.976 correctly?

Again I have supplied a clip:
http://www.bestsharing.com/files/b6J1F357233/11.ts.html
http://rapidshare.com/files/66432921/11.ts.html

neuron2
31st October 2007, 13:19
selecteven()
decimate()

harissa
2nd November 2007, 01:37
how can I identify the right pulldown to use
Pulldown(0,2)
Pulldown(1,3)
Pulldown(2,4)
Pulldown(0,3)
Pulldown(1,4
Is the D2V Parse Output can provid a good information easy to understand ?

neuron2
2nd November 2007, 03:05
The D2V file shows only flagging for soft telecine. It can't help you for hard telecine.

If you want to do things manually, you have to inspect the field pattern by eye, or try each one and see which works. It's easier to use an automatic solution such as Telecide()/Decimate() or TFM()/TDecimate().

laserfan
2nd November 2007, 13:03
I am trying to render files...Sometimes getting a good result from broadcast HDTV can be a real PIA. Maybe something in this post (http://forum.doom9.org/showthread.php?p=1018937#post1018937) or thread will help you.

drtj
7th November 2007, 19:52
Just out of sheer curiosity, what is the benefit of broadcasting in 1080i? 1080P looks just fine on a tube TV. Is there a financial factor involved making is cheaper to broadcast in an interlaced format?

I know there is a difference in the amount of information that is transmitted between 1080i vs 1080P, but it seems that even the 1080i broadcasts are fairly large, why not just switch to 1080P? Can't be that much more information, can it?

Thanks laserfan for the suggestion. Looking into...

And again, thank you neuron2 for all your help and the programs that you have put out there for all of us to use that makes all of this possible.

Dark Shikari
7th November 2007, 19:58
Just out of sheer curiosity, what is the benefit of broadcasting in 1080i? 1080P looks just fine on a tube TV. Is there a financial factor involved making is cheaper to broadcast in an interlaced format?

I know there is a difference in the amount of information that is transmitted between 1080i vs 1080P, but it seems that even the 1080i broadcasts are fairly large, why not just switch to 1080P? Can't be that much more information, can it?

Thanks laserfan for the suggestion. Looking into...

And again, thank you neuron2 for all your help and the programs that you have put out there for all of us to use that makes all of this possible.1080i = half the data of 1080p.

laserfan
8th November 2007, 01:55
...thank you neuron2 for all your help and the programs that you have put out there for all of us...FYI drtj if you have not found them already you should read-and-study-and-read-again the various Help files that neuron2 has provided with all of his tools. They are always attached/included as html files. A lot of times freeware docs are an afterthought; his are truly instructive/useful/outstanding stuff.

drtj
8th November 2007, 23:04
Well I guess the better question is what is the difference between the amount of information between hard telecined and 1080P.

I can see how pure interlaced 1080i is 1/2 the data of 1080P since each frame is a composite of 2 frames.

But with telecined material there are progressive frames, and only 2 out of 5 in a series are interlaced. So does that mean it is roughly 2/5 the data of full 1080P broadcast of the same episode?

I have captured a bunch of material from my STB and just trying to figure what the difference is in quality aside from broadcasting degradation in terms of file size and such just as a comparison and out of curiosity.

@laserfan: I agree, his stuff is truly instructional and very informative and I reference them all the time. I would have been lost without them.

tateu
9th November 2007, 01:26
1080i = half the data of 1080p.

That's only true if you are comparing 1080p60 (60 frames per second) to 1080i60 (60 fields, 30 frames per second). 1080p30 (30 frames per second) and 1080i60 contain the same amount of data.