PDA

View Full Version : D2V Analyzer tool !


Dark-Cracker
4th January 2004, 04:28
Hi,

i have made a quick and crap tool to get some informations on a .d2v file. i have use the .avs file used in autoGK (so all the greet for the script go to len0x ).

this tool give u the fps, nbr of frame, FILM and VIDEO percent, combed percent.

URL :
-----
http://dark.pluridis.org/~darkangel/D2vAnalyze.zip

HOW TO USE :
------------
select the .d2v file.
select if it's a NTSC or PAL material.
enter the percent of movie to analyse (by default 10%).
Click on the analyse button.

how to interpret the result :

if u have a percent of FILM around 90 percent u can use decomb with guide=0 (same than force film).
if u have a combed percent around 40% (=~ 2 frames on 5 are combed => telecined material) more than 40% => NTSC interlaced material.

i have not yet finish to calculate the right threshold to detect NTSC hybrid or Hybrid FILM so if u have some value feel free to post them :)

Special Greets : Neuron2 for the decomb & parsed2v tool :)

Bye.

kitsaros2000
4th January 2004, 16:52
hey Dark-Cracker thats the idea that i had ! I Will check out the tool right now ! THX !

Later : I have an Interlaced pal film and the result was : 16,13 % is it right ?

Dark-Cracker
4th January 2004, 18:03
yes for pal if u have more than 1% of combed frame => interlaced dvd :)

i will continu more tests to get right threshold.

PS: if u test on a short sample think to increase the % of movie analyzed.

Bye.

kitsaros2000
4th January 2004, 20:39
ok !!!
Dark-Cracker i think that making an silly table with all the cases would be usefull ! Thx

Also in that table propose the assosciated filter with the best settings second your opinion of course .. :D

bilu
4th January 2004, 22:24
if u have a percent of FILM around 90 percent u can use decomb with guide=0 (same than force film). Force Film = Telecide(post=2).Decimate(guide=1)if u have a combed percent around 40% (=~ 2 frames on 5 are combed => telecined material) more than 40% => NTSC interlaced material.
The 40% combed applies to each 5 frame cycle. len0x made this sort of analisys to deal with hard-telecined sources (hardware telecine process with no MPEG-2 repeat flags in the D2V, instead of 0123 or 2301 everything is 0000 or 2222). But since a Telecined source is like this:

ABBCD
ABCDD

only 2 in every 5 frames look combed, in this case frames 3 and 4.
You may already know this stuff, but I had to say it because after testing on neuron2's Star Trek hybrid clip (100% analisys) I got:

FILM percent:22,98
VIDEO percent:77,02

Frames:1136
FPS: 29,97 (NTSC)

Frames Analysed:440
Frames combed:86
Percent:19,55

The FILM/VIDEO percent is correct, because MPEG-2 RFF flags are specified and you were able to get it through ParseD2V. But not the latter percent analisys, because you can't just divide combed over moving. It's not that simple.


IsCombed().IsMoving() in FILM part
=======================================
false.true
false.true
false.true
true.true
true.true
false.true
false.true
false.true
true.true
true.true
false.true
false.true


IsCombed().IsMoving() in Video part
=======================================
false.true
false.true
false.true
true.true
false.true
false.true
false.true
false.true
true.true
false.true
false.false


You'll notice that a pattern like this is what makes it FILM:

false.true
false.true
false.true
true.true
true.true

So you can't just count combed over all the moving parts and calculate if it gets a 40% percentage. Hybrid movies have moving VIDEO parts that would screw the percentage.

So in my opinion you should:
1) Rely on ParseD2V when it's possible to call it FILM based on its results, no need for analisys in this case;

2) Analyse the D2V with len0x method and consider

false.true
false.true
false.true
true.true
true.true

as 5 frames with a Telecine pattern, and calculate FILM percent based on this;


BTW, could you make a command line version? ;)


EDIT: No need for a NTSC/PAL parameter, you could parse the D2V file for this:
Frame_Rate=23976 (NTSC with Force FILM)
Frame_Rate=29970 (NTSC)
Frame_Rate=25000 (PAL)


Best regards,
Bilu

mf
4th January 2004, 22:33
I'm wondering if MPEG2Dec3 can output frame properties (like decomb does for combing and decimation hinting), which Telecide and Decimate could be made to read out. I'd like to be able to use Force Film without immediately decimating the framerate. Also, sometimes, force film manages to catch small combing that Telecide ignores. A FILM hint for such frames could make it alot easier on Telecide.

bilu
5th January 2004, 01:04
Originally posted by mf
I'm wondering if MPEG2Dec3 can output frame properties (like decomb does for combing and decimation hinting), which Telecide and Decimate could be made to read out. I'd like to be able to use Force Film without immediately decimating the framerate. Also, sometimes, force film manages to catch small combing that Telecide ignores. A FILM hint for such frames could make it alot easier on Telecide. This is the second idea I see today for an MPEG2DEC3 extension, the other is this one:

How to determine, whether a frame is I P or B for Conditionalfilter?
http://forum.doom9.org/showthread.php?s=&threadid=68096

He's looking for a way to do it over MPEG-2 DVB streams.

Made a compiled thread for this new requests:
http://forum.doom9.org/showthread.php?s=&threadid=68100

Bilu

Dark-Cracker
5th January 2004, 11:34
@kitsaros2000
yes once the detection will be accurate i will put a more understandable result :)

@bilu

oups i wanted to say decimate=0 not guide.

yes i have not yet implement telecine patterns, because i have not found hybrid clip so my first idear was to get the % of combed frame on all movie.
i will add the % of telecine/interlaced patter :)
i hope this will give more accurate analyze :)

i am still a beginer with the NTSC material :) all comment are welcome (even if my english not let me to fully understand sentenses :) ).

Ps: why not a command line ^^
Ps: i know u can use the framerate to detect ntsc or pal material but for avoid programming issues i have add a manual parameter :) i will try to solve this later :)

@all
does someone have field-blended PAL sample ?

Bye.

bilu
5th January 2004, 11:38
@D-C

Have you catched the "smilitis" disease? ;)

About field-blended: I don't have such samples but I'm curious about what do you want to do with them :confused:


Bilu

len0x
5th January 2004, 11:43
Originally posted by bilu

About field-blended: I don't have such samples but I'm curious about what do you want to do with them :confused:


me too :)
They will be recognised as interlaced source...

Mug Funky
5th January 2004, 18:48
it's easy enough to make a field blended PAL if you have an MPEG-2 coder available...

just grab an ntsc (hybrid 24 30?) clip and run it though:

bob(height=576,0,1)
converttoyuy2(interlaced=[true/false depending on source])
convertfps(50)
separatefields()
selectevery(4,0,3)
weave()

run that through CCE or whatever (encode non-interlaced if you want an example of EXTREMELY crappy PAL conversion... i've encountered such DVDs and it took me quite a while to wipe the puke off my teev) and then make a d2v for the resulting m2v file.

Didée
5th January 2004, 19:47
Mug Funky:

No, it's not that easy. At least not if you want to simulate the job that converter boxes are usually doing.

Scharfis_brain once posted a similar script to simulate a converter box, and got my veto.
Due to the fact you're converting a telecined stream, the result of bobbing+ConvertFPS delivers a) too much blending and b) even wrong blending: you get a lot of blends of fields (n + [n+2]), and that's evil. Converter boxes always deliver blends of fields (n + [n+1]), to my experience. Somehow, those boxes (at least the good ones) manage to reckognize the telecine pattern and to adapt their blending scheme accordingly. In fact, converter boxes often do a pretty smart job (I hate to say that ;) ).

I'd like to link to a corresponding thread on neuron2's forum, but there seems to be some problem - cannot open anything but the main page: connection lifetime expired.

Fooled by my own firewall :o
Here (http://forum.doom9.org/showthread.php?s=&threadid=61792&perpage=20&pagenumber=1&postid=376945) is above function of Mug Funky, invented by Scharfis_brain in September '03. (Way down, almost bottom of page *) )
Here (http://neuron2.net/ipw-web/bulletin/bb/viewtopic.php?p=1955#1955) is my reply to Scharfis_brain (beginning of post).
Nothing new in there, though.

*) After half an hour of fighting, I gave up.
HOW IS THE BL**DY FU**ING DAMN URL-SYNTAX TO LINK TO A SPECIFIC POST ON DOOM9's FORUM??? AAAARGH!!



- Didée

Leak
5th January 2004, 22:29
Originally posted by Didée
I'd like to link to a corresponding thread on neuron2's forum, but there seems to be some problem - cannot open anything but the main page: connection lifetime expired.

Well, neuron2.net's forum works for me at this time of the evening.

Try again. :D

np: Sole - Famous Last Words (Bottle Of Humans)

kitsaros2000
6th January 2004, 11:25
Dark-Cracker since im not an expert with the interlation stuff and i already making a dvd player i will wait till your programm matures . It will be a very usefull program keep progging :D :cool: :D

bilu
6th January 2004, 11:42
From what I've heard so far about DVD players it seems that NTSC players can also do the Telecine process themselves over FILM (23,976 fps). Still don't know if this is true for most players, but if it is then this sort of analisys is also good to some extent for NTSC movies, saving 20% bitrate! :D

Bilu

Dark-Cracker
18th February 2004, 22:19
hi,

just a quick update :)
now it use a better pattern.

how to understand results :

1) NTSC Material :

a) if it say u FILM percent > 90 %
=> u nedd use force film :
Telecide(post=2).Decimate(guide=1)

[ if FILM % was under 90% don't take care of it ]

b) if u have Telecined % > 80 %
=> telecined material , need to ivtc :
Telecide(guide=1).Decimate(cycle=5)

c) if u have Telecine % < 80 % it's surely hybrid clip
- if Telecine % > Interlaced % + Progressive % => Hybrid Mostly FILM. do :
Telecide(guide=1,post=2).Decimate(mode=3,threshold=1.0)

- else it's an hybrid mostly NTSC , do :
Telecide(guide=1,post=2).Decimate(mode=1,threshold=1.0)

PS : or perhaps a ",gthresh=30" in the telecine instead of post=2 (not sure).

2) PAL Material
a) if u have Interlaced % > 10 % it's an interlaced matrial do a simple deinterlace filter.


It's the first time a play with NTSC material and i hope i don't have made mistake :) else feel free to post a msg to explain me where i am wrong and which value is better :) .

Ps : and i suppose bilu will be the first to do this :)

Bye.

Dreassica
18th February 2004, 22:27
If u still need that fieldblended pal sample, i can up a sample vob of a madman pal anime dvd. :P

bilu
18th February 2004, 23:10
Indeed :D
a) if it say u FILM percent > 90 %
=> u nedd use force film :
Telecide(post=2).Decimate(guide=1)Force Film decimates already, no need for Decimate(guide=1).

The rest is correct :)
PS : or perhaps a ",gthresh=30" in the telecine instead of post=2 (not sure). :confused: post=2 is fine, believe me ;)


Bilu

PS: I've changed my focus from MPEG-4 on Windows to MPEG-2 on Linux/FreeBSD. Still in the learning phase at kvcd.net :)

So I'll be here at doom9.org less often than before: there's not much talk about mencoder/ffmpeg/ffvfw for MPEG-2 around here :D