I'm trying to find a way to run a combing detection algorithm through AviSynth. I know of two functions that could be used Decomb/IsCombed and TIVTC/IsCombedTIVTC. Has anyone experience with those functions and knows if one is more accurate than the other?
Now I'd like to run this function on every frame and output a log that would say something like "combing from frame X to Y" every time combing is detected. The algorithm would be as follow
I'm not sure how to write that in AviSynth unfortunately. I've also found this scriptCode:bool combingFound := false for-each frame in clip { if isCombed(frame) { if !combingFound { combingFound := true startFrame := frame } } else { if combingFound { combingFound := false writeLog("Combing from " + startFrame + " to " + frame) } } }
From http://avisynth.nl/index.php/Interlace_detection but I don't understand how to interpret the results. It looks like the log needs to be fed to something else for interpretation. I've tried using the standalone but I'm getting an error trying to run it on a script.Code:<input> global unused_ = blankclip(pixel_type="yv12", length=10).TFM() file="<temporary-file.log>" global sep="-" function IsMoving() { global b = (diff < 1.0) ? false : true } c = SelectRangeEvery(every=<every>,length=<length>) global clip = c c = WriteFile(c, file, "a", "sep", "b") c = FrameEvaluate(c, "global a = IsCombedTIVTC(clip, cthresh=9)") c = FrameEvaluate(c, "IsMoving") c = FrameEvaluate(c,"global diff = 0.50*YDifferenceFromPrevious(clip) + 0.25*UDifferenceFromPrevious(clip) + 0.25*VDifferenceFromPrevious(clip)") crop(c,0,0,16,16)
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 4 of 4
Thread
-
-
What are you trying to achieve what no one else before you ever tried? Don't reinvent the wheel, especially not with only little insight in all the possible reasons why they go more or less round. A really elaborate algorithm to detect interlacing or telecine will not only look at one frame separately, it would compare several fields instead.
-
Something as simple as
Code:colon = ": " WriteFile("CombInfo.txt", "current_frame", "colon", "IsCombedTIVTC(last, cthresh=9)", flush=true)
Code:0: false 1: false 2: false 3: true 4: true 5: false 6: false
Last edited by jagabo; 2nd Sep 2019 at 11:30.
-
Thank you jagabo, this will do the trick! I can easily write a script to parse those results.
Similar Threads
-
Show Frame type (I, P, B) in Avisynth
By zerowalk in forum EditingReplies: 6Last Post: 7th Aug 2019, 02:00 -
Why frame numbers in VirtualDub and Avisynth different?
By Megafox in forum Newbie / General discussionsReplies: 5Last Post: 15th Sep 2018, 11:56 -
Frame Rate, Bitrates ans Frame by frame comparison
By novreis in forum Newbie / General discussionsReplies: 1Last Post: 5th Feb 2018, 17:40 -
[avisynth] how to double frame rate?
By marcorocchini in forum Newbie / General discussionsReplies: 6Last Post: 11th Feb 2016, 19:02 -
Frame Blend Frame Rate Conversion with Scene Change Detection
By ndjamena in forum RestorationReplies: 7Last Post: 3rd Nov 2015, 09:26