View Full Version : Requesting advice on automatic source detection program
berrinam
2nd January 2006, 02:14
On the MPEG-4 AVC forum (http://forum.doom9.org/showthread.php?t=104760), I posted a program I had written which attempts to detect the source type (progressive, interlaced, telecined, or some hybrid) of an avs file. People recommended that I ask for suggestions in particular from tritical, scharfis_brain and neuron2. I would appreciate it if anyone had a look at it, and give suggestions, because (a) I don't have much experience in this, and (b) I don't have much in the way of test material.
berrinam
3rd January 2006, 22:15
*Bump*
Could someone please take a look at this?
Wilbert
3rd January 2006, 22:54
Perhaps Dark-Cracker can help you. He uses this in AutoRV. I believe stax also uses something like this in Staxrip. Just send them a pm if they don't respond here.
Mug Funky
4th January 2006, 08:12
auto field-order detection would be very nice :)
stax76
4th January 2006, 18:31
I believe stax also uses something like this in Staxrip.
Not yet but there is demand so I hope I have soon time to work on it. Too bad I'm clueless about about the topic but I will try to read up on it.
sh0dan
4th January 2006, 19:59
ok - some thoughts on it:
* Detecting interlaced frames
This is fairly straightforward, but it is impossible in static scenes. Therefore you need to sample a fairly big portion of the movie. You could use motion estimation to see if you have movement, so if average or median motion vector is below a threshold, don't use the metrics. This should get you quite reliable interlaced/progressive frame detection.
* Hybrid or Interlaced
This is probably the hardest distinction to make, since large parts of the material can be one, while 5% can be the other. You need many samples to be certain that it is one or the other.
berrinam
5th January 2006, 09:30
@Everyone: I have extended my program. Can you please look at it. I have posted it here (http://forum.doom9.org/showthread.php?p=762441#post762441)
@Anyone: Does anyone have some non-copyrighted hybrid clips which I can test this on, or am I just asking way too much?
auto field-order detection would be very nice :)
Yep, done. Head over to my new version that I've linked to above.
ok - some thoughts on it:For starters, thanks for putting your time into this.
* Detecting interlaced frames
This is fairly straightforward, but it is impossible in static scenes. Therefore you need to sample a fairly big portion of the movie. You could use motion estimation to see if you have movement, so if average or median motion vector is below a threshold, don't use the metrics. This should get you quite reliable interlaced/progressive frame detection.Yes, I basically do this. My Avisynth script is basically identical to AutoGK's, which, for each of the frames analyzed, outputs the result of IsCombed, and outputs a thresholded Y/U/VDifferenceFromPrevious metric. I analyze these in groups of 5 frames (so as to pick up the telecine patterns), ignoring any group of 5 which doesn't have 5 moving frames. This seems to work quite well.
* Hybrid or Interlaced
This is probably the hardest distinction to make, since large parts of the material can be one, while 5% can be the other. You need many samples to be certain that it is one or the other.With my tests, it is surprising how little analysis you can get away with (I am currently only analysing 1% of the video). I suppose the real question here is this: how much of the smaller amount must you have before you declare it hybrid, or do you always declare it hybrid, just to be on the safe side?
Revgen
5th January 2006, 09:53
@Anyone: Does anyone have some non-copyrighted hybrid clips which I can test this on, or am I just asking way too much?
Do you live in the U.S.?
Using copyrighted material for educational or research purposes is not illegal here.
foxyshadis
5th January 2006, 19:08
It's against the rules of the board though.
Hybrid check: definitely check the opening and credit areas, as they most commonly differ from the main program.
If you want to make your own, you can always make judicious use of trims, dgpulldown, and weave to simulate progressive/pulldown/interlace hybrids.
I'd recommend archive.org's mpeg2 section except that downloading gigs and gigs looking for a hybrid video is a bit overkill...
berrinam
5th January 2006, 23:14
Concerning hybrid video:
How much of an error would people accept in determining if something is hybrid? For example, GK recommends that if more than 95% of the source is film, then it should be Force Filmed (ie declared as not a hybrid). This means that 5% could end up looking bad. Do people accept that level of error?
I am asking, because I am trying to find sensible thresholds for hybrid content, and am wondering whether this can be used as a guide.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.