Log in

View Full Version : Good IVTC avs script/filter for HDTV ts.


JnZ
16th February 2006, 23:43
Hi evryone,
I want to ask everyone, who gets some skills with good IVTC method for HDTV .ts files, and share my experiances too, of course.

Last few months I do some HDTV encodings (.ts 1080i -> 720p XviD). But after testing many 29,97->23.976 conversion filters discovered this:

Some HDTV's is FILM > 95%, so this isn't problem, but I met some pieces, which was film, but manytimes switched to "interlaced". When uses "Forced film" in DGindex, gets video, which was choppy.

So I analyzed this types HDTV's and discovered this:
Frames are stored: (P - progresive, I - interlaced)
P P P I I P P P I I P P P I I P P P I I ........
- Two interlaced frames contains four fields 0,1,2,3, fields 1+2 are my wanted progresive frame.
- Problem is, this pattern usual changes few times in whole video (someone cut-out adverts?).

Tried:
1)
doubleweave()
pulldown(0,3)
Result: Choppy in some scenes.

2)
Telecide(order=1,guide=0).Decimate()
Result: Ok, but little slow and no good quality

Today I make own script exactly "made-by-measure" for this purpose. It make fully progresive 23.976fps video, and can be adapted for many HDTV (but maybe for many not?). You must only manually find cutting points and rewrite this frames.
LoadPlugin("DGDecode.dll")
mpeg2source("blablabla.d2v") #project from dgindex, don't check forced film!
crop(0,0,1920,1080) #crop as you need

#this is first part of video
video1 = trim(4,80647)
I1 = video1.SelectEvery(5,3,4).SeparateFields().SelectEvery(4,1,2).Weave()
P11 = video1.SelectEvery(5,0)
P21 = video1.SelectEvery(5,1)
P31 = video1.SelectEvery(5,2)
Video1 = Interleave(P11,P21,P31,I1)

#this is second part of video
video2 = trim(80648,171976)
I2 = video2.SelectEvery(5,3,4).SeparateFields().SelectEvery(4,1,2).Weave()
P12 = video2.SelectEvery(5,0)
P22 = video2.SelectEvery(5,1)
P32 = video2.SelectEvery(5,2)
Video2 = Interleave(P12,P22,P32,I2)

#this is third part of video
video3 = trim(171977,193518)
I3 = video3.SelectEvery(5,3,4).SeparateFields().SelectEvery(4,1,2).Weave()
P13 = video3.SelectEvery(5,0)
P23 = video3.SelectEvery(5,1)
P33 = video3.SelectEvery(5,2)
Video3 = Interleave(P13,P23,P33,I3)

return (video1+video2+video3).LanczosResize(1280,720) #I want 720p output
- video1+2+3 = 3 parts, which had "shifted" pattern. You may extend for more parts as you wants.
- You must find cutting points manually, then find next first I-frame, and your frame is: ([this I-frame] - [3]).
- best way is disable LanczosResize and first looks, if all frames are deinterlaced properly, then activate resize.

I'm apologizing for this long "spam", but many HDTV's is too different, and good script/filter is welcomed.

If you know better way, pls share. Thx.
Johnny

Guest
17th February 2006, 00:30
Telecide(order=1,guide=0).Decimate()
Result: Ok, but little slow and no good quality What do you mean by "no good quality".

Have you considered that your suboptimal results might be caused by misuse of the tools? Why don't you post an unprocessed source clip so that I can show you how to do it correctly?

JnZ
17th February 2006, 01:20
What do you mean by "no good quality".
Have you considered that your suboptimal results might be caused by misuse of the tools? Why don't you post an unprocessed source clip so that I can show you how to do it correctly?
Maybe I use bad express. I compare frames processed by Telecide... and my filter and "mine" looks better.
There are same frames procesed by Telecide.... and my script:
http://img131.imageshack.us/img131/957/telecidex0ie.th.jpg (http://img131.imageshack.us/my.php?image=telecidex0ie.jpg)
Telecide(order=1,guide=0).Decimate()
http://img111.imageshack.us/img111/8112/my8ue.th.jpg (http://img111.imageshack.us/my.php?image=my8ue.jpg)
My script

Another thing, Telecide is little slow. Tested: Huffyuv v2.1.1 codec, fast recompress, 1280x720. Speeds:
Telecide: ~12fps
My script: ~25fps

Source clip is over 8G big. It's standard MPEG-2 1080i .ts HDTV source (I think). I try to make short clip.

P.S.: Myabe I'm doing something wrong with Telecide...

Guest
17th February 2006, 01:23
You're probably postprocessing too much. Try post=0 to Telecide(). Also, verify that you have the correct field order set.

JnZ
17th February 2006, 01:41
You're probably postprocessing too much. Try post=0 to Telecide(). Also, verify that you have the correct field order set.
Order is good. When set post=0, still many slower than my script.

Test clip is here: DELETED

I know, my sollution is little hardcore, but works fine.
I'm laboring with this long time...but still not satisfied.

Thx for help neuron.
P.S.: In DGindex I set honor pulldown flags, it's right settings?

Guest
17th February 2006, 05:08
Dead link.

JnZ
17th February 2006, 10:22
Dead link.
Strange,it works for me. Damn free hosting... :(
Try this:
http://rapidshare.de/files/13455353/test20031.m2v.html
Click to FREE and wait aprox 30sec.
Scripts to ivtc this clip:
#Telecide:
LoadPlugin("DGDecode.dll")
LoadPlugin("decomb.dll")
mpeg2source("test20031.d2v")
trim(4,framecount)
crop(0,0,1920,1080)
Telecide(order=0,guide=0,post=0).Decimate()

#my filter:
LoadPlugin("DGDecode.dll")
mpeg2source("test20031.d2v")
crop(0,0,1920,1080)
video1 = trim(4,framecount)
I1 = video1.SelectEvery(5,3,4).SeparateFields().SelectEvery(4,1,2).Weave()
P11 = video1.SelectEvery(5,0)
P21 = video1.SelectEvery(5,1)
P31 = video1.SelectEvery(5,2)
Video1 = Interleave(P11,P21,P31,I1)
return video1

1) Trim(4,framecount) - need to set my script to right offset (P P P I I ....)
2) After trying this clip, both filters give same results, but:
3) When processing whole video, I must set order=1, first two parts was processed good, but last part was bad (because cut-points?).
4) Telecide is really slow to process HD video.

EDIT: After many laboring with lots of HDs, I must say, Telecide is very good and adaptive filter. Little slow, but very good. In many cases it disappointed, because many HDs have lot of errors, so I'm using own script, original for each HD.