View Full Version : MeGUI's Source Detector Options
hello_hello
23rd January 2012, 22:37
Could someone please explain MeGUI's Source Detector options to me as though I'm a complete idiot? I couldn't find any info on them in the help files. I assume it's the settings for "Source Detector" which effect the video analysis. The options are as follows and the values listed are the defaults.
Analysis %: 1 (seems fairly self explanatory)
Minimum analysis sections: 150.
Hybrid Threshold %: 5.
Hybrid Field order Threshold %: 10.
Portions allowed: Default is unchecked.
Portion Threshold: 5.0
Maximum Number of Portions: 5
Also does anyone recommend changing these settings at all? I ask because quite often I encode DVDs twice. Once using AutoGK and Xvid and again using MeGUI and x264.
It's not that MeGUI tends to do a bad job but AutoGK never seems to get it wrong and after an analysis MeGUI and AutoGK don't always seem to agree on the video type. I'd just like to understand how the analysis works a little better.
Thanks.
djmasturbeat
26th January 2012, 22:42
thanks for this topic.
I have also wondered about these settings, and the wiki, et al are lacking info on many areas like this.
hello_hello
27th January 2012, 18:31
Don't thank me yet. Not until, or if, we get an answer..... ;)
Zathor
5th January 2013, 18:16
Sorry to answer to such an old post.
No, I do not know those options but if required I can dig into the source code to find the answers.
It's not that MeGUI tends to do a bad job but AutoGK never seems to get it wrong and after an analysis MeGUI and AutoGK don't always seem to agree on the video type.
Can you provide a sample file where MeGUI detect the source type wrong?
hello_hello
5th January 2013, 20:48
Wow, how did you find this thread? I'd forgotten about it.
"Different" may be more accurate to "wrong" when comparing MeGUI to AutoGK. I can probably find an example of MeGUI wanting to use TIVTC on a PAL DVD, which seems unusual to me (but maybe I've got no idea) and I'm pretty sure I can remember the NTSC DVD I was converting which prompted this thread. I think the force film option in MeGUI was the culprit there. At the time I didn't know using force film changed the d2v file which is why the stuff I was copying from AutoGK's AVISynth script wasn't fixing the problem.
I don't think AutoGK ever uses force film, but I've seen it agree with MeGUI after an analysis then run a second pass looking for optimal hybrid thresholds and change it's mind. On the odd occasion one program will output 23.976 and the other 29.970 and to me AutoGK seems to make the right choice. It doesn't happen often but I can think of one example. Slitting off a section of a vob file which causes them to disagree mightn't be easy. I mightn't get to it for a day or two but I'll see if I can.
Zathor
6th January 2013, 15:58
Take your time - there is no need to hurry. If you find such an example please let me know.
hello_hello
10th January 2013, 20:07
Zathor,
I think a while ago in one of the MeGUI threads I asked if after an analysis and MeGUI adds it's de-interlacing to the script, if selecting the same de-interlacing method manually should add the same thing to the script. At the time you replied it should, but I think by the time I read it I'd forgotten why I asked. Move on to today and I'd forgotten I even asked the question. I wish I hadn't.
So after messing with a few different NTSC DVDs and trying to find which one would replicate the "MeGUI gets it wrong problem" I think I finally worked out it isn't. After I analyse a particular NTSC DVD and MeGUI displays it as "Partially Film, Top Field First", it adds this to the script:
tfm(order=1).tdecimate(hybrid=1)
Next time I open the same DVD I simply select Partially Film, top field first, and MeGui adds this:
tfm(order=1).tdecimate(hybrid=3)
So even though MeGUI chose Partially Film and added the correct stuff to the script, anything I manually add using Partially Film is wrong for the DVD I'm using for testing. Switch to "Hybrid Film/Interlaced, Mostly Film" and any of the deinterlacing methods I choose manually seem to work correctly (the output is 23.976fps and looks fine).
I assume after an analysis MeGUI picked the correct de-interlacing but showed the incorrect method in the de-interlacing section, but because MeGUI seems to have been misleading me I don't know what the distinction between "Partially Film" and "Hybrid Fim/Interlaced, Mostly Film" should be in terms of what MeGUI adds to the script. A brief explanation there would be appreciated. Then I might be able to work out why I've struggled to get my head around this NTSC thing using the de-interlacing method MeGUI displays as a guide. :(
And Hybrid=3. I've looked in the TDecimate help files but it's not mentioned specifically..... Any ideas what is does?
For the record, AutoGK decided the above DVD was Pure Film, then added this to it's script:
Telecide(guide=1,post=2).Decimate(mode=0)
Now for PAL..... I've found a source which causes MeGUI to declare the video to be "Hybrid Film/Interlaced, Mostly Interlaced" and causes it to add this to the script:
tfm(order=1).tdecimate(hybrid=3)
Which I guess mightn't be wrong as such but doesn't de-interlace as well as Yadif. AutoGK is happy for the same DVD to be purely interlaced.
LeakKernelDeInt(order=1,sharp=true)
Do you need a sample of that one or is it just a case of telling MeGUI not to do that if it's PAL?
Zathor
10th January 2013, 21:54
Do you need a sample of that one or is it just a case of telling MeGUI not to do that if it's PAL?
Please provide a sample for both problems - the hybrid one for PAL and the one with the wrong method selected but correct script.
hello_hello
10th January 2013, 22:15
PS. I thought the NTSC DVD I've been playing around with above was one which gave me grief when MeGUI's force film option was enabled, but I guess I remember that wrong, however I still think the Script Creator could use a tweak in that respect. If force film is applied it's done by altering the d2v file so DGDecode simply serves up progressive video even if a small percentage of it isn't. I get that, but when force film has been applied, the video analysis becomes redundant because the result is going to be either progressive or progressive. Once force film is applied I think it'd be an idea to disable the analysis and maybe simply display "force film/progressive".
The other reason I think that'd be a good idea is because if force film is applied MeGUI doesn't let you know, so I think it's possible to preview the video and decide some sort of IVTC should be applied to a section of it, manually change the de-interlacing method but find it has no effect. Maybe I'm remembering wrong, or missing the point of force film, but I'm sure I did that once or twice before the penny dropped and I disabled force film completely.
hello_hello
10th January 2013, 22:17
Please provide a sample for both problems - the hybrid one for PAL and the one with the wrong method selected but correct script.
No problem. Probably not for a day or two now as I've got some real world stuff to do and it might be hard to extract a small section which gives the same result..... but I will.
hello_hello
17th March 2013, 17:18
Zathor,
Finally.... Here's a sample of NTSC video which illustrates the problem I've been describing.
If I let MeGUI analyse it, it decides the video is partially film, the field order is varying, chooses TIVTC and adds the following to the script:
tfm(order=-1).tdecimate(hybrid=1)
The problem isn't with the analysis as such, I think MeGUI is getting it right.... the problem is if I manually choose partially film, varying field order and TIVTC, MeGUI writes something different to the script:
tfm(order=-1).tdecimate(hybrid=3)
I'm pretty sure "hybrid=1" is correct, but either way I'd assume manually selecting the same de-interlacing which MeGUI chooses itself after the analysis should result in exactly the same script. In the above case the difference in the output is 23.976fps vs 29.970fps.
This has driven me a little batty on a few occasions trying to work out why the output wasn't what I expected if I'd changed the de-interlacing manually. I guess as I live in PAL-land and don't work with NTSC video much I can be forgiven for being a little slow to work it out.
Could I also get you to explain the distinction between "partially interlaced", "partially film" and the two hybrid options? If the "hybrid" options are for NTSC and the "partially" options are for PAL, then maybe MeGUI should have selected "Hybrid mostly film" for this sample video? Or maybe there's a further distinction between the "hybrid" and "partially" options I don't yet understand.
Anyway, here's the link. I'll work on finding a problem PAL sample a bit later. http://depositfiles.com/files/8j5ocvbr5
Cheers.
PS. You might want to disable the use of "force film" before analysing the sample, although I think the NTSC/film ratios are close enough for it not to be applied.
hello_hello
17th March 2013, 19:05
Well finding/extracting a small PAL sample to upload proved a little easier than finding the NTSC sample did, so here it is. After the analysis, MeGUI chooses Hybrid/Mostly Interlaced, Top Field First, TIVTC and adds the following to the script:
tfm(order=1).tdecimate(hybrid=3)
Which I guess would be fine if it was NTSC, but to the best of my knowledge, not so much for PAL.
The sample is taken from an episode ripped from DVD. I think it's 100% interlaced, and for most episodes MeGUI chooses interlaced (or maybe partially interlaced) and Yadif, but every now and then it goes for Hybrid and TIVTC instead.
http://depositfiles.com/files/pq7co92i1
Cheers.
Zathor
17th March 2013, 19:34
If I let MeGUI analyse it, it decides the video is partially film, the field order is varying, chooses TIVTC and adds the following to the script:
tfm(order=-1).tdecimate(hybrid=1)
The problem isn't with the analysis as such, I think MeGUI is getting it right.... the problem is if I manually choose partially film, varying field order and TIVTC, MeGUI writes something different to the script:
tfm(order=-1).tdecimate(hybrid=3)
Thanks - fixed in 2307 (already online)
Could I also get you to explain the distinction between "partially interlaced", "partially film" and the two hybrid options? If the "hybrid" options are for NTSC and the "partially" options are for PAL, then maybe MeGUI should have selected "Hybrid mostly film" for this sample video? Or maybe there's a further distinction between the "hybrid" and "partially" options I don't yet understand.
From looking into the source code (I am not dealing with film myself as I life in PAL land)
"Partially interlaced": Mix of interlaced & progressive
"Partially film": Mix of film & progressive
"Hybrid film/interlaced. Mostly film": Like the name suggest - mix of film & interlaced
"Hybrid film/interlaced. Mostly interlaced" Like the name suggest - mix of film & interlaced
In 2308 I have enabled detailed anaylsis results also in the log (before only available in OneClick)
Well finding/extracting a small PAL sample to upload proved a little easier than finding the NTSC sample did, so here it is. After the analysis, MeGUI chooses Hybrid/Mostly Interlaced, Top Field First, TIVTC and adds the following to the script:
tfm(order=1).tdecimate(hybrid=3)
Which I guess would be fine if it was NTSC, but to the best of my knowledge, not so much for PAL.
Please compare the values in the detailed analysis result with the correct episodes. Also you can ask the experts in the AVS forum if this source has indeed no film part. And you can change the hybrid threshold in the Source Detector Options in the MeGUI settings.
EDIT: This is my result for your file:
-[NoImage] Progressive sections: 5
-[NoImage] Interlaced sections: 89
-[NoImage] Partially Static Sections: 66
-[NoImage] Film Sections: 5
-[NoImage] Source is declared hybrid film/ntsc. Majority is ntsc (interlaced).
-[NoImage] Source is declared tff by a margin of 52 to 4.
EDIT2: Raising hybrid threshold to 10% gives "Interlaced"
-[NoImage] Progressive sections: 5
-[NoImage] Interlaced sections: 89
-[NoImage] Partially Static Sections: 66
-[NoImage] Film Sections: 5
-[NoImage] Source is declared interlaced.
-[NoImage] Source is declared tff by a margin of 52 to 4.
EDIT3: Or increasing the "Analys percent" or the sections
hello_hello
18th March 2013, 03:09
From looking into the source code (I am not dealing with film myself as I life in PAL land)
"Partially interlaced": Mix of interlaced & progressive
"Partially film": Mix of film & progressive
"Hybrid film/interlaced. Mostly film": Like the name suggest - mix of film & interlaced
"Hybrid film/interlaced. Mostly interlaced" Like the name suggest - mix of film & interlaced
This is where I'm still a little unclear as to whether manually selecting "Partially film" was causing the wrong thing to be added to the script, or whether MeGUI made the wrong choice, but that choice caused the wrong thing to be added to the script which cancelled the first wrong out and made it correct. :)
Here's what I mean.....
The only distinction I can see between "Hybrid film/interlaced, mostly interlaced" and "Hybrid film/interlaced, mostly film" is the output framerate which would result.
The former would give you 29.97fps and the latter 23.976, and as best as I can tell what's manually added to the script when selecting any of the three de-interlacing methods for each, is correct to produce the corresponding frame rate.
Currently, when you manually select any of the de-interlacing methods after choosing "Partially Film" what's added to the script is exactly the same as what's added to the script if you choose "Hybrid film/interlaced, mostly interlaced".
You've now changed one of those "Partially Film" de-interlacing options to match "Hybrid film/interlaced, mostly film" instead, but did you change Tdient(EDI) and Decomb IVTC as well? Currently when selecting Partially Film and either of those, it's also exactly the same as selecting them when choosing "Hybrid film/interlaced, mostly interlaced".
Assuming you changed all three so when selecting "partially interlaced" the output will be the same as "Hybrid film/interlaced, mostly film", it also causes exactly the same thing to be added to the script, which effectively makes the entire "partially film" option redundant.
I hope I'm explaining this well, but that takes me back to my question.... after analysing the NTSC sample, should MeGUI have chosen "Hybrid film/interlaced, mostly film" instead of "partially film" in the first place? What is added to the script would have been exactly the same and the output would have been exactly the same either way.
To my way of thinking, "Hybrid film/interlaced, mostly film" would be for material which is a combination of (telecined) 23.976 and 29.970 interlaced (NTSC), whereas "Partially Film" would be for a mix of 23.976 progressive and 29.970 progressive.... or something along those lines, but currently either choice results in the same script. So my question would be, should they be de-interlaced differently?
The "Partially Interlaced" option is obviously quite distinct from either of the hybrid options, but "partially film" should either be doing something different or it's redundant..... or I'm still not understanding it completely. Maybe as you're also in PAL-Land we should find an NTSC expert to consult?
Please compare the values in the detailed analysis result with the correct episodes. Also you can ask the experts in the AVS forum if this source has indeed no film part. And you can change the hybrid threshold in the Source Detector Options in the MeGUI settings.
Is 25fps progressive ever labelled as "film"? I'm not sure it is, but maybe I'm wrong, however is this the result after you analysed the PAL sample? That's what I was getting at, if it's PAL it can only be progressive or interlaced, or a combination of the two, but not a hybrid. At least that's my understanding. MeGUI though, seems to think it's NTSC.
EDIT: This is my result for your file:
-[NoImage] Progressive sections: 5
-[NoImage] Interlaced sections: 89
-[NoImage] Partially Static Sections: 66
-[NoImage] Film Sections: 5
-[NoImage] Source is declared hybrid film/ntsc. Majority is ntsc (interlaced).
-[NoImage] Source is declared tff by a margin of 52 to 4.
Zathor
18th March 2013, 22:49
...but "partially film" should either be doing something different or it's redundant...
Maybe - don't know as well.
The source type ntsc/pal or the frame rate is not used in the detection at all. The detection is based only on frame differences - at least that is what I think it is being done. Have a look yourself:
http://sourceforge.net/p/megui/code/2308/tree/megui/trunk/core/gui/SourceDetector.cs
hello_hello
19th March 2013, 01:01
Thanks. I'll check it out a bit later, assuming I can understand it. :)
I might do a little investigating on the subject of de-interlacing to see if I can find some further info. Probably in a different forum as there's a lot more activity, but if I manage to find anything out which might be relevant to MeGUI's de-interlacing I'll report back. It seems logical to me if there's two different de-interlacing "categories" they should do different things, otherwise there's probably no point in having both, but anything's possible.
Have you changed the other two "partially film" de-interlacing options as well (when they're chosen manually) so they all result in the same output frame rate?
Cheers.
Zathor
19th March 2013, 08:08
Have you changed the other two "partially film" de-interlacing options as well (when they're chosen manually) so they all result in the same output frame rate?
Yes. The "film flag" was missing
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.