Hi guys,
I need an avisynth script that can determine regions that don't change between two consecutive frames, then replaces those regions in the current frame with those of its predecessor.
any suggestions are greatly appreciated.
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 14 of 14
Thread
-
Last edited by romeo; 28th May 2021 at 17:23.
-
-
It's what I (I thought) replied to him some hours ago (but something went wrong while submitting, I suppose).
To make an example: if you have a frame 1 with a content like ABCDEFGHI (using letters instead of value to simplify) and a frame 2 with ABXYEFGZI... then the parts not changed in frame 2 are (using square brackets to highlight them) [AB]XY[EFG]Z[I]... If you replace with the values that are the unchanged from frame 1.. [AB]CD[EFG]H[I] .. you will (obviously) simply obtain the same content you already have : ABXYEFGZI.
So.. what is the result you were REALLY trying to achieve ? -
I saw this earlier and didn't respond for the same reasons. Either I didn't understand the question properly, or it made no sense at all. Romeo, please either rephrase the question or find someone to write it so it can be better understood. Although your command of English seems very good.
-
Isn't this exactly what normal video encoding does? hence why you can get high quality video with small file sizes.
-
No, you're totally wrong.
COPYING similarities between adjacent frames is NOT AT ALL what encoding algorithms do.
They don't COPY the SAME information from one frame to the next one: they REMOVE information from some frames (exploiting similarities between adjacent frames). -
Thanks for your replies.
To clarify, I will use the example set by krykmoon :
Say we have two consecutive frames. If frame 1 contains ABCDEFGHI parts, and frame 2 contains ABXYEFGZI, then the parts not changed in frame 2 are ABEFG. I want to copy these parts from frame 1 to frame 2.
This idea came from dup filter, which replaces the current frame with the previous one if they are determined to be close enough to each other.Last edited by romeo; 29th May 2021 at 11:21.
-
Thanks for your replies.
To clarify, I will use the example set by krykmoon :
Say we have two consecutive frames. If frame 1 contains ABCDEFGHI parts, and frame 2 contains ABXYEFGZI, then the parts not changed in frame 2 are ABEFG. I want to copy these parts from frame 1 to frame 2.
This idea came from dup filter, which replaces frame 2 with frame 1 if they are determined to be close enough to each other. -
What you describe is still a nonsense, romeo. Copying something that is ALREADY the same (leaving the rest unchanged) simply does ABSOLUTELY NOTHING.
Think simply about letters, not regions. If i have the word MONSTER (frame 1) and then the world COASTER (frame 2) and I copy the COMMON letters from the previous word(frame) leaving the rest unchanged M[O]N[STER] .. i will copy O, STER parts - and leave C, A (what differs) the same.. I'm only obtaining COASTER again.
Another more simple example to clarify: if I have a basket (frame 1) with 4 apples and 3 bananas.. and a second basket with 4 apples, 1 pear, 1 peach, 1 strawberry... if I remove the fruits that are in common from the second basket (frame 2) - the 4 apples - changing them with the 4 apples (common content) from the first one... and leave the rest of the fruits (not in common) in the second basket.... what will be the content of the second basket after this operation ?
But since you mentioned dup filter.. I finally understood what you need.
The filter you mentioned doesn't copy the common part of a frame to the next ones (leaving the rest unchanged, like you wrote): it DETECTS if among a group of adjacent frames there's a percentage of content that remains the same.. and if that's the case it will copy THE WHOLE initial frame content to the adjacent ones (not only the common part.. as you said... that would be a totally senseless and pointless thing to do).
So.. here's how the dup filter works and its parameters.
http://avisynth.nl/index.php/Dup -
Thanks for the explanation. It's already clear .
I know exactly what this filter does. I just mentioned it to make you understand what I need, but unfortunately, I failed .
Let me try to explain again what the script should do with two consecutive frames (frame 1 and frame 2):
It divides both of them in the exact same way into multiple parts ABCDE...etc, then compares each part (for example part A) of frame 1 with the corresponding part (A) of frame 2.
If the percentage of similarity between the two parts is greater than 90% (a certain threshold), then that part is copied from frame 1 to frame 2. Else, nothing is done.
Hopefully, it's all clear now.Last edited by romeo; 29th May 2021 at 13:13.
-
You want to copy only the parts which are nearly the same, and you think this is worth doing?? Here's my answer:
https://www.youtube.com/watch?v=3ANufwUPFm8 -
I think,therefore i am a hamster.
Similar Threads
-
Replace current video frame by duplicate of previous/next with "hot keys"
By semel1 in forum Newbie / General discussionsReplies: 2Last Post: 1st Feb 2021, 13:05 -
PotPlayer copy either current subtitle timestamps OR current audio clip
By Sakusuke in forum Software PlayingReplies: 0Last Post: 29th Aug 2020, 13:35 -
Current PAL/NTSC DVD Conversion Guide? Current Guides are outdated
By isj209h23h in forum User guidesReplies: 3Last Post: 20th Jul 2018, 22:53 -
Use ffmpeg to replace frame with previous frame if frames are X % different
By dkrichards16 in forum ffmpegX general discussionReplies: 0Last Post: 29th Apr 2017, 17:27 -
Trouble copying parts of a video file and pasting them back in the original
By J Tinsby in forum EditingReplies: 1Last Post: 16th Sep 2016, 00:03