Log in

View Full Version : Parsed2v tool utilisation


Dark-Cracker
14th May 2003, 22:21
Hi,

can someone could explain me how to detect if the .d2v is pal/ntsc interlaced/progressive/hybrid ... using your tool parsed2v.

i have read in the r4r_enc thread it analyse the log file produce by parsed2v to detect if the source was hybrid or not.

i suppose u coud use fps to detect if it pal or ntsc.

if it pal detect how to detect if it interlaced.

for ntsc could u explain me how to find the right settings to use for decomb.

thank u
Bye

Guest
15th May 2003, 02:27
I assume DVD2AVI version 1.76 in what follows...

Originally posted by Dark-Cracker
can someone could explain me how to detect if the .d2v is pal/ntsc Use the frame rate for PAL vs NTSC.

interlaced/progressive/hybrid ... using your tool parsed2v.The flags required to tell are not stored in the D2V file. For PAL, you cannot tell. For NTSC, if you see a standard 3:2 pulldown pattern, you have a film, which is progressive. But you can have progressive content without the 3:2 signature if the content is "hard telecined". These things are all explained in the IVTC tutorial in the DVD2AVI forum. In the output of the ParseD2V tool, video sections are marked with "[pattern break]", which simply means that the 3:2 signature is absent.

i have read in the r4r_enc thread it analyse the log file produce by parsed2v to detect if the source was hybrid or not.If they see no pattern break frames they assume pure film. If they see all pattern break frames, they assume video (but it may not be true). If they see both, they assume hybrid.

if it pal detect how to detect if it interlaced. There's no way from the flags. You have to analyse the video content. You can look for combing or you can look for repeated fields.

for ntsc could u explain me how to find the right settings to use for decomb.Please see the Decomb help file and then post about anything you don't understand.

bilu
16th May 2003, 04:20
Originally posted by neuron2
If they see no pattern break frames they assume pure film. If they see all pattern break frames, they assume video (but it may not be true). If they see both, they assume hybrid.

There's no way from the flags. You have to analyse the video content. You can look for combing or you can look for repeated fields.


AVS PART
========
function Deinterlace(clip c,int D2V_Video,int D2V_Film) {
ivtc_mode=(D2V_Video > D2V_Film)? "1":"3"
c= (c.framerate > 24)? AutoIVTC(c,ivtc_mode):Telecide(c,guide=0)
return c
}

function AutoIVTC(clip c, string ivtc_mode){
IVTC= (c.framerate > 25)? "Decimate(Telecide(c,guide=1,gthresh=30),mode="+ivtc_mode+",threshold=1.0)":"Telecide(c,guide=2,gthresh=30)"
return eval(IVTC)
}

Usage: Deinterlace(45553,0) for example.

BATCH PART:
===========
%parsed2v%\parsed2v %D2VFILE% > %ENCDIR%\d2v.LOG
for /f "usebackq delims=: tokens=3" %%I in (`find /c "[3:2 pattern break]" %ENCDIR%\d2v.LOG`) do set D2V_Video=%%I
for /f "usebackq delims=: tokens=3" %%I in (`find /c /v "[3:2 pattern break]" %ENCDIR%\d2v.LOG`) do set D2V_Film=%%I


It counts how many pattern breaks and not-breaks there are in the logfile, and then do this:

- if framerate < 25 fps, do Telecide(guide=0);
- if framerate = 25 fps, do Telecide(guide=2,gthresh=30);

- if framerate > 25 fps and

FILM > VIDEO = Decimate(mode=3,threshold=1.0)
VIDEO > FILM = Decimate(mode=1,threshold=1.0)

after Telecide(guide=1,gthresh=30)

The main obstacle to automatic detection with ParseD2V seems to be a mostly FILM stream being treated like a mostly VIDEO stream, which means lots of blended fields instead of correct IVTC.

Still this is a risk I'm willing to make on my automizing tool, but alerting people to this, of course. There are films that are not hard-telecined and those, I hope, will benefit from this procedure.

Best regards,
Bilu

Dark-Cracker
16th May 2003, 19:04
hi,

thank u for your answer :)

i suppose to detect interlace i must find if there is 1 half frame followed by 1 full frame followed by 1 half frame.

perhaps somethink like :

0
1
0

or

2
3
2

because it seems to me 0,2 are for 1 frame and 1,3 for 0.5 frame.

i am right ? it is "repeated fields" ?

PS: sorry for my questions but technical english is very hard to understand if english was not your mother language.

Bye.

Guest
17th May 2003, 04:27
Your sequences are not legal (strictly, they are legal but not correct) and you need to refer to the tutorial I referenced.

You can have for example a series like this:

2 2 2 2 2 2 2 2 2 2 2 2 ...

...and it can be either interlaced or progressive. The 2 just specifies the field order as top field first.

Note: 0 and 2 are indeed "for one frame". 1 and 3 are "for 1.5 frames", i.e., a field is repeated. But you can have interlaced video without any repeat flags.

As I said earlier, the required flags to specify interlaced/progressive are not present in the .D2V file.

In the absence of reliable flags, to detect interlacing you need to measure a combing metric for the frames. There are many possible combing metrics. You can use FieldDeinterlace's source code as one starting point.

If you can trust the MPEG flags, it would be possible to enhance DVD2AVI to place the appropriate flags in the .D2V file. But even then a frame could be coded as interlaced but not have any combing (because there was no motion).

Dark-Cracker
17th May 2003, 12:26
thank u very much for your answer :) but i think my knowledge in interlaced movie is too limited for the moment :) but i will continue to search.

Bye.