Log in

View Full Version : Set field order


Ryo94
28th June 2010, 02:36
Hi,

I'm using staxrip to convert to Xvid a dvd movie, the source is hybrid, but after verified that 99% of the interlaced part of the movie have BFF order I used telecide and I get great results. This is the script

LoadPlugin("C:\StaxRip 1.1.6\Applications\AviSynth plugins\Decomb\Decomb.dll")
LoadPlugin("C:\StaxRip 1.1.6\Applications\AviSynth plugins\DGDecode.dll")
MPEG2Source("D:\BACKUP\#DVDs\Movie (DVD9)\VTS_02_1 temp files\VTS_02_1.d2v")
Crop(0,0, -Width % 8,-Height % 8)
ConvertToYV12()
AssumeBFF().Telecide(ovr="filter.tel")
Crop(8,64,-8,-66)
LanczosResize(704,384)

In the filter.tel file is specified that vthresh=30 must be applied to the range 78655,78965.

Now the problem is that there is a little scene (10 seconds) that appears to have TFF field order because the scene is awfully deinterlaced (I verified that changing the field order to TFF in the script this segment looks great but it ruins the rest of the interlaced part of the movie).
So I would like to know if there is any way to set in the script that only that segment (frames 85602,85951) it's TFF without affect the previous field order set for the rest of the movie.

Thanks in advance for any help.

Revgen
28th June 2010, 08:24
dgindex should handle this by itself. If you created your .d2v file with Honor Pulldown Flags, then it should correct it. If not, then the flags aren't set properly.

Alex_ander
28th June 2010, 08:48
Assuming dgindex didn't complain, it likely had failed to detect change in field order. Try something like this to unify it:
AssumeBFF()
trim(0,85601)++trim(85602,85951).AssumeTFF().DoubleWeave().SelectOdd()++trim(85952,0)

stickboy
28th June 2010, 19:51
Assuming dgindex didn't complain, it likely had failed to detect change in field order. Try something like this to unify it:
AssumeBFF()
trim(0,85601)++trim(85602,85951).AssumeTFF().DoubleWeave().SelectOdd()++trim(85952,0)
Or just call Telecide separately on the separate segments and then splice them together.

Ryo94
29th June 2010, 01:13
Thanks to all for reply,

Assuming dgindex didn't complain, it likely had failed to detect change in field order. Try something like this to unify it:
AssumeBFF()
trim(0,85601)++trim(85602,85951).AssumeTFF().DoubleWeave().SelectOdd()++trim(85952,0)

Yes, looks like dgindex failed to detect the field order change ("honor pulldown flags" is enabled), I tried this line and also replacing DoubleWeave().SelectOdd() by telecide() but didn't work, for some reason the deinterlacing is not applied to the frame range I specified :(

Or just call Telecide separately on the separate segments and then splice them together.

Please, could you drop me that little script? I never joined video segments before, I tried this...
trim(0,85601).AssumeBFF().Telecide(ovr="filter.tel")
trim(85602,86751).AssumeTFF().Telecide()
trim(86752,0).AssumeBFF().Telecide()
trim(0,85601) ++ trim(85602,86751) ++ trim(86752,174583)
Crop(8,64,-8,-66)
LanczosResize(704,384)
... but must be errors in the script since the video is not loaded completely but only 3 frames :confused:

Thanks in advance for any help.

Gavino
29th June 2010, 01:31
I tried this line and also replacing DoubleWeave().SelectOdd() by telecide() but didn't work, for some reason the deinterlacing is not applied to the frame range I specified :(
I think Alex_ander meant you to add that line after MPEG2Source. Did you do that?
I tried this...
... but must be errors in the script since the video is not loaded completely but only 3 frames :confused:
a=trim(0,85601).AssumeBFF().Telecide(ovr="filter.tel")
b=trim(85602,86751).AssumeTFF().Telecide()
c=trim(86752,0).AssumeBFF().Telecide()
a++b++c
Crop(8,64,-8,-66)
LanczosResize(704,384)

Ryo94
29th June 2010, 01:53
I think Alex_ander meant you to add that line after MPEG2Source. Did you do that?
I didn't know that the line must be there (sorry for my ignorance I´m new in avisynth) but I add it now and I get; "script error: invalid argument to function BFF"

a=trim(0,85601).AssumeBFF().Telecide(ovr="filter.tel")
b=trim(85602,86751).AssumeTFF().Telecide()
c=trim(86752,0).AssumeBFF().Telecide()
a++b++c
Crop(8,64,-8,-66)
LanczosResize(704,384)

Works like a charm! Thanks a lot Gavino!!! :thanks: :thanks:

Ryo94
29th June 2010, 02:24
I made some mistake when added the Revgen's line, now it load without problems but that line seems to not change nothing at all, anyway if dgindex is able to handle this problem automatically I would like to know what should I do because I just found many other short fragments in the movie with the field order changed and there will be probably more, checking the whole movie in order to determine what segment are BFF or TFF would be a tremendous headache :(

Gavino
29th June 2010, 09:19
anyway if dgindex is able to handle this problem automatically I would like to know what should I do because I just found many other short fragments in the movie with the field order changed and there will be probably more, checking the whole movie in order to determine what segment are BFF or TFF would be a tremendous headache :(
Have you tried just removing AssumeBFF() from your script?
Avisynth is able to keep track of the field order for each frame independently. I don't know what DGIndex/MPEG2Source does in 'handling the problem automatically', but in principle it could set the flag differently for each frame, based on what it finds in the source.

Ryo94
29th June 2010, 20:37
Yes, I tried but then I get a lot of dupe frames in many parts, the interlaced pattern in those part seems to be 3:2, I tried using decimate but didn't help to much at time of removing accurately those duplicate frames.

Revgen
30th June 2010, 04:24
^DGIndex can only solve the problem if the RFF flags indicate a field-order change. Years ago when I capped TS streams from TNTHD, there would be field order changes, but DGIndex detected when these changes occurred and asked me if I wanted to fix these field order changes and create a new .d2v file. I answered yes and it created a .d2v file where the field order remained consistent. If your stream doesn't have that information in the RFF flags, then dgindex can't do anything. You have to fix it the hard way.