VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 23 of 23
Thread
  1. Member
    Join Date
    Aug 2019
    Location
    Michigan
    Search PM
    My source is telecined in progressive. It has a B/C and C/D frame blend. I had some help on here that whipped up a looping sequence where it subtracted 2 previous frames from the current frame (I think, I am not sure honestly).

    Code:
    Overlay(last, Loop(2,0,0).ColorYUV(gain_y=-220, cont_u=-220, cont_v=-220), mode="subtract").ColorYUV(gain_y=40, cont_u=40, cont_v=40)
    I was wondering if this could be used to only subtract B from C, then delete C/D so its back to 24 fps?
    Quote Quote  
  2. That's the basic idea. You need to adjust the ColorYUV values to subtract the correct amount. Post a sample of your source.
    Quote Quote  
  3. Member
    Join Date
    Aug 2019
    Location
    Michigan
    Search PM
    Originally Posted by jagabo View Post
    That's the basic idea. You need to adjust the ColorYUV values to subtract the correct amount. Post a sample of your source.
    001.Uncompressed Sample.avi

    Here you are my friend!
    Quote Quote  
  4. Why reinvent the wheel?

    SRestore(omode="pp3")
    TDecimate(Mode=1)
    Image Attached Files
    Quote Quote  
  5. Member
    Join Date
    Aug 2019
    Location
    Michigan
    Search PM
    Originally Posted by manono View Post
    Why reinvent the wheel?

    SRestore(omode="pp3")
    TDecimate(Mode=1)
    WOW THATS ALL IT TOOK! Amazing thank you so much! I've been stuck on that for so long! Can you go into detail about what the script is achieving?
    Quote Quote  
  6. There's also FixBlendIVTC().
    Quote Quote  
  7. Member
    Join Date
    Aug 2019
    Location
    Michigan
    Search PM
    Originally Posted by jagabo View Post
    There's also FixBlendIVTC().
    After the sample the pattern shifts a couple frames. Do I need to clip each part or will both of these methods automatically pick it up?
    Quote Quote  
  8. They adapt to shifts in the pattern.

    By the way, FixBlendIVTC requires a TDecimate too.
    Quote Quote  
  9. Member
    Join Date
    Aug 2019
    Location
    Michigan
    Search PM
    Originally Posted by jagabo View Post
    They adapt to shifts in the pattern.
    Perfect. Thank you gentlemen I am very happy!
    Quote Quote  
  10. Member
    Join Date
    Aug 2019
    Location
    Michigan
    Search PM
    Originally Posted by jagabo View Post
    They adapt to shifts in the pattern.

    By the way, FixBlendIVTC requires a TDecimate too.
    im getting an error, I'm getting this with both scripts:

    Average: All clips must be have same or greater number of frames as the first one
    Last edited by Fraugster; 30th Aug 2019 at 10:45.
    Quote Quote  
  11. Member
    Join Date
    Aug 2019
    Location
    Michigan
    Search PM
    Originally Posted by manono View Post
    Why reinvent the wheel?

    SRestore(omode="pp3")
    TDecimate(Mode=1)
    I'm getting an error message with your script. See above post for error message.
    Quote Quote  
  12. It's probably an incompatible plugin. There has been lots of development in AviSynth plugins lately with all the new AviSynth+, 64 bit processing, high bit depth support, etc. Since the filters are made by many different people at different times it can be hard to get a compatible set of filters together.
    Quote Quote  
  13. Member
    Join Date
    Aug 2019
    Location
    Michigan
    Search PM
    Originally Posted by jagabo View Post
    It's probably an incompatible plugin. There has been lots of development in AviSynth plugins lately with all the new AviSynth+, 64 bit processing, high bit depth support, etc. Since the filters are made by many different people at different times it can be hard to get a compatible set of filters together.
    I've ruled it out to be my srestore. I got mine from somewhere else on the wiki. The one on the main page gives me a "I dont know what AvsPlusVersion Number means?"
    Quote Quote  
  14. On my computer Srestore(omode="pp3") crashes 32 bit AviSynth (I haven't tracked down the problem since I don't normally use that mode) but works fine in 64 bit AviSynth+. FixBlendIVTC works in both.
    Quote Quote  
  15. Member
    Join Date
    Aug 2019
    Location
    Michigan
    Search PM
    Originally Posted by jagabo View Post
    On my computer Srestore(omode="pp3") crashes 32 bit AviSynth (I haven't tracked down the problem since I don't normally use that mode) but works fine in 64 bit AviSynth+. FixBlendIVTC works in both.
    I'm assuming my 32 bit plugins wont work with 64 bit AVISynth+? Im hesitant to switch to AVI+ because of how delicate avisynth is to run for me properly. I have the regular 32 bit avisynth at present
    Quote Quote  
  16. Here's a possible workaround for you with 32 bit AviSynth. Use SRestore v2.796 from the wiki:

    http://avisynth.nl/index.php/Srestore

    Then add "global AvsPlusVersionNumber = 0" to the top of your AviSynth script. That worked for me with 32 bit AviSynth (no plus).

    Code:
    global AvsPlusVersionNumber = 0
    
    AviSource("001.Uncompressed Sample.avi") 
    SRestore(omode="pp3")
    TDecimate(Mode=1)
    Quote Quote  
  17. That error comes up when you have an older smdegrain version. It's not listed as a dependency, but there are some checks in the smdegrain script

    https://forum.doom9.org/showthread.php?p=1881139#post1881139

    or use an older srestore version
    Quote Quote  
  18. Member
    Join Date
    Aug 2019
    Location
    Michigan
    Search PM
    Originally Posted by jagabo View Post
    Here's a possible workaround for you with 32 bit AviSynth. Use SRestore v2.796 from the wiki:

    http://avisynth.nl/index.php/Srestore

    Then add "global AvsPlusVersionNumber = 0" to the top of your AviSynth script. That worked for me with 32 bit AviSynth (no plus).

    Code:
    global AvsPlusVersionNumber = 0
    
    AviSource("001.Uncompressed Sample.avi") 
    SRestore(omode="pp3")
    TDecimate(Mode=1)
    Well... I didnt see your code. I punched in the 'global AvsPlusVersionNumber = 0' into the AVSI of srestore and that fixed it! Is there any additional cleanup I can do to the artifacting of the frame that was removed? It also didn't entirely remove some blended frames which still exist
    Quote Quote  
  19. Originally Posted by Fraugster View Post
    It also didn't entirely remove some blended frames which still exist
    In the sample? Anyway, you can thank your crappy source. Is this really from a retail DVD, or did some fool get his hands on it and ruin it before you got it? Since you showed us a resized and lossless AVI rather than an M2V from a DVD, I'm guessing someone else "worked" on this before you got it. When the pattern changes - like maybe after a scene change - it takes some number of frames for SRestore to lock onto the new cadence. So, yes, some still blended frames might slip through.

    Is there any additional cleanup I can do to the artifacting of the frame that was removed?
    I didn't understand that. There were instances where the wrong frame of the pair was removed by TDecimate. I couldn't figure out how to fix that. If you're willing to put a lot of manual work into it, Override files can be used to remove the correct frame - to choose the other frame of a duplicate pair over a range of frames - like the 'echos' or 'blends' that show up for a few seconds beginning at around 9 seconds in during the sample.

    Also, when checking over your source, you can't just go directly to the place you want to check expecting the blends to have been removed. You have to begin 100 or so frames early to give SRestore a chance to lock onto the cadence.
    Quote Quote  
  20. Member
    Join Date
    Aug 2019
    Location
    Michigan
    Search PM
    Originally Posted by manono View Post
    Originally Posted by Fraugster View Post
    It also didn't entirely remove some blended frames which still exist
    In the sample? Anyway, you can thank your crappy source. Is this really from a retail DVD, or did some fool get his hands on it and ruin it before you got it? Since you showed us a resized and lossless AVI rather than an M2V from a DVD, I'm guessing someone else "worked" on this before you got it. When the pattern changes - like maybe after a scene change - it takes some number of frames for SRestore to lock onto the new cadence. So, yes, some still blended frames might slip through.

    Is there any additional cleanup I can do to the artifacting of the frame that was removed?
    I didn't understand that. There were instances where the wrong frame of the pair was removed by TDecimate. I couldn't figure out how to fix that. If you're willing to put a lot of manual work into it, Override files can be used to remove the correct frame - to choose the other frame of a duplicate pair over a range of frames - like the 'echos' or 'blends' that show up for a few seconds beginning at around 9 seconds in during the sample.

    Also, when checking over your source, you can't just go directly to the place you want to check expecting the blends to have been removed. You have to begin 100 or so frames early to give SRestore a chance to lock onto the cadence.
    This source is actually from the PC version of the game. When I first looked at the file I realized it wasnt in its native res. It was upscaled to 1080, probably bicubic or some other algorithm. So I shrank it back down to its native res and then exported the uncompressed AVI. Thats what you see in the sample.

    Regarding the artifacting, I am indeed willing to put some manual time into this source as I know it needs the love. I don't have any knowledge on override files or how to even get started, but I am willing.

    Lastly, I thought that might have been the case, sometimes when I jump to a spot the blends are gone and some are not. I was making sure it had something to do with AVISynth before I began exporting. Thanks for the clarification!
    Quote Quote  
  21. I was wrong about being able to fix it using an override file. It's not that choosing the other of the duplicate frames will fix it. It's in unique frames, apparently caused by SRestore. It's also in another filter I sometimes use for the same thing, Exblend. About the only way to fix that sort of thing is with frame interpolation, especially since it only occurs sometimes. And frame interpolation can be hit or miss. When it works it works spectacularly, but when it misses, you can get all kinds of nasty artifacts. The script used for the included video is this:

    SRestore(omode="pp3")
    Tdecimate(Mode=1)
    FixBadFrames("218 222 226 230 234 238 242 246 250 254")


    This is FixBadFrames.avs:

    function FixBadFrames(clip c, string frames) {
    # Replace each frame from a list of 'bad' frames by using MFlowInter to interpolate
    # between the nearest pair of 'good' frames
    c
    sup = MSuper()
    bv = MAnalyse(sup, isb=true, delta=2)
    fv = MAnalyse(sup, isb=false, delta=2)
    candidates = MFlowInter(sup, bv, fv, time=50.0, ml=100).DuplicateFrame(0)
    ReplaceFramesSimple(candidates, mappings=frames)
    }


    It needs MVTools2 and RemapFrames to make it work. During that stretch beginning at about the 9 second mark, you get this white crap every four frames. And then it stops. So, you'll have to go through the whole thing to find where it occurs. Who knows, maybe this is the only time in the whole video where you get that.
    Image Attached Files
    Last edited by manono; 30th Aug 2019 at 21:25.
    Quote Quote  
  22. Member
    Join Date
    Aug 2019
    Location
    Michigan
    Search PM
    Originally Posted by manono View Post
    I was wrong about being able to fix it using an override file. It's not that choosing the other of the duplicate frames will fix it. It's in unique frames, apparently caused by SRestore. It's also in another filter I sometimes use for the same thing, Exblend. About the only way to fix that sort of thing is with frame interpolation, especially since it only occurs sometimes. And frame interpolation can be hit or miss. When it works it works spectacularly, but when it misses, you can get all kinds of nasty artifacts. The script used for the included video is this:

    SRestore(omode="pp3")
    Tdecimate(Mode=1)
    FixBadFrames("218 222 226 230 234 238 242 246 250 254")


    This is FixBadFrames.avs:

    function FixBadFrames(clip c, string frames) {
    # Replace each frame from a list of 'bad' frames by using MFlowInter to interpolate
    # between the nearest pair of 'good' frames
    c
    sup = MSuper()
    bv = MAnalyse(sup, isb=true, delta=2)
    fv = MAnalyse(sup, isb=false, delta=2)
    candidates = MFlowInter(sup, bv, fv, time=50.0, ml=100).DuplicateFrame(0)
    ReplaceFramesSimple(candidates, mappings=frames)
    }


    It needs MVTools2 to make it work. During that stretch beginning at about the 9 second mark, you get this white crap every four frames. And then it stops. So, you'll have to go through the whole thing to find where it occurs. Who knows, maybe this is the only time in the whole video where you get that.
    I see what you mean haha

    Click image for larger version

Name:	frame interp lol.png
Views:	11
Size:	435.7 KB
ID:	49981

    So it wont do good for some frames. Which is fine, making the number of bad frames smaller will be nice. If I have to go into photoshop and fix a few hundred frames I dont mind. Is there any other automated method that would work or is frame interp my only option?
    Quote Quote  
  23. Oh, you're willing to work in Photoshop, eh? I'm working on something and just fixed a frame in a photo editor myself. It couldn't be interpolated because the movement was too fast.

    Right, the picture shows what can happen. Movement too fast, one object moving behind another, too much difference in brightness and/or contrast between in the two frames on either side of the artifacted one, all kinds of stuff. The frames I used it on in the sample came out nicely.

    If only a part of a frame needs interpolating, that can be done and maybe spare the parts that are moving quickly. You can create a mask so the filtering is done only on the part you want, leaving the rest alone. You can use FreezeFrame (useful with animations) to make a frame look identical to the one before or after. But sometimes there's nothing to do but dig into your favorite photo editor and then replace the broken frame with the fixed one.

    The interpolator I showed you will only fix a single frame and it's useless to include adjoining frames. For fixing multiple frames in a row, look for ReplaceFramesMC here on Videohelp.com.
    Quote Quote  



Similar Threads