VideoHelp Forum
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. Member
    Join Date
    May 2021
    Location
    Belgique
    Search PM
    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.
    Last edited by romeo; 28th May 2021 at 17:23.
    Quote Quote  
  2. Originally Posted by romeo View Post
    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.
    Can you clarify ? Basically you want to do nothing ?

    If regions don't change, they are already the same in both frames. If you replace those regions that don't change in the current frame with the previous frame, they are already the same (they didn't change) ...
    Quote Quote  
  3. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    Originally Posted by poisondeathray View Post
    If regions don't change, they are already the same in both frames. If you replace those regions that don't change in the current frame with the previous frame, they are already the same (they didn't change) ...
    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 ?
    Quote Quote  
  4. 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.
    Quote Quote  
  5. Member darkknight145's Avatar
    Join Date
    Feb 2007
    Location
    Australia
    Search PM
    Isn't this exactly what normal video encoding does? hence why you can get high quality video with small file sizes.
    Quote Quote  
  6. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    Originally Posted by darkknight145 View Post
    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).
    Quote Quote  
  7. Member
    Join Date
    May 2021
    Location
    Belgique
    Search PM
    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.
    Quote Quote  
  8. Member darkknight145's Avatar
    Join Date
    Feb 2007
    Location
    Australia
    Search PM
    Originally Posted by krykmoon View Post
    Originally Posted by darkknight145 View Post
    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).
    Yeah, sorry, had a brain fart.
    Quote Quote  
  9. Member
    Join Date
    May 2021
    Location
    Belgique
    Search PM
    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.
    Quote Quote  
  10. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    Originally Posted by romeo View Post
    if you have a frame 1 with a content like ABCDEFGHI (letters represent regions) and a frame 2 with ABXYEFGZI, then the parts not changed in frame 2 are ABEFG. I want to copy these parts from frame 1 to frame 2.

    I wanted to do what dup filter does (it replaces the current frame with the previous one 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
    Quote Quote  
  11. Member
    Join Date
    May 2021
    Location
    Belgique
    Search PM
    Originally Posted by krykmoon View Post

    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 ?
    Thanks for the explanation. It's already clear .

    Originally Posted by krykmoon View Post
    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
    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.
    Quote Quote  
  12. Member
    Join Date
    May 2021
    Location
    Belgique
    Search PM
    Do you have any suggestions?
    Quote Quote  
  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
    Quote Quote  
  14. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Originally Posted by romeo View Post
    Do you have any suggestions?
    Just leave the video as it is,if you want to replace frames with more info than before then you will have a much bigger video file than before with no visual improvements at all.
    I think,therefore i am a hamster.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!