Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
8th July 2003, 23:40 | #1 | Link |
Registered User
Join Date: Feb 2002
Location: Charlotte, NC USA
Posts: 1,984
|
conditional choice of frame from 2 streams
I'm looking for a way to conditionally choose frames from one of two streams based on scene change detection. It doesn't have to be absolutely perfect.
Here's the thought: Starting with a raw source stream, establish a second stream through a filter. A test is done such that frame X comes from the filtered stream unless a test of frame X+n shows a scene change. This allows a way to reduce the unwanted effects of temporal smoothing across scene changes. If Donald Graft's Dup is modified such that it would, if instructed, return only a boolean for change detection given the frames X and X+n, this would be fairly easy from a user standpoint. The regular Dup functionality could be used to tune configuration for a given source. Construction of the output stream would, essentially, be choosing frames from either input stream based on the state switch of the boolean. Questions: 1) Is there a filter which provides scene change detection for a specified frame and returns a boolean? 2) If so, how would a stream be constructed from two source streams?
__________________
Reclusive fart. Collecting Military, Trains, Cooking, Woodworking, Fighting Illini, Auburn Tigers Last edited by FredThompson; 8th July 2003 at 23:44. |
9th July 2003, 01:22 | #2 | Link | |
Registered User
Join Date: Feb 2002
Location: Charlotte, NC USA
Posts: 1,984
|
ok, I've tracked this issue down to the ConditionalFilter. From this page:
http://www.avisynth.org/index.php?pa...ditionalFilter There is an example in the middle of the page: Quote:
If there's a way to use temporalsoften such that the source frame isn't affected by the scene change frame, that would be cool. Hope that makes sense. FWIW, here's the filter I'm trying to modify: ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= 2 ? \ unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \ TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1) ")
__________________
Reclusive fart. Collecting Military, Trains, Cooking, Woodworking, Fighting Illini, Auburn Tigers |
|
9th July 2003, 02:05 | #4 | Link |
Registered User
Join Date: Feb 2002
Location: Charlotte, NC USA
Posts: 1,984
|
Yeah, it might, thanks.
The filter I've shown above will work on an entire stream. The only thing it's doing which I/d like to change is how it processes the final frame before a scene change. Thanks, I'll do some more research. |
9th July 2003, 09:27 | #5 | Link |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
It's difficult to help you, without trying myself. But does something like this work:
clip_u = [unfiltered clip] cilp_f = [filtered clip] ConditionalFilter(clip_u, clip_f, clip_u, "YDifferenceToNext()", ">", "10", true) edit: corrected small mistake Last edited by Wilbert; 9th July 2003 at 10:29. |
9th July 2003, 18:49 | #6 | Link |
Registered User
Join Date: Feb 2002
Location: Charlotte, NC USA
Posts: 1,984
|
That's what I was thinking lately.
Leave the current algorithm alone because it filters quite well. Use another ConditionalFilter to chose between its stream or the original. I'd started with bilu's idea then realized what a style mistake I'd made by planning to alter the filter. Thanks for the feedback. |
|
|