VideoHelp Forum
+ Reply to Thread
Page 2 of 3
FirstFirst 1 2 3 LastLast
Results 31 to 60 of 73
Thread
  1. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    I can't see the AVI files, codecs unknown. Use something standard if you want help.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  2. Originally Posted by lordsmurf
    I can't see the AVI files, codecs unknown.
    MJPG.
    Quote Quote  
  3. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    That's really, really weird, then. I have (OF COURSE!) MJPEG on this system -- it's one of my primary encoding laptops for off-site/on-location video projects.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  4. Member pirej's Avatar
    Join Date
    Mar 2008
    Location
    Macedonia
    Search Comp PM
    Jagabo, its definitively a tedious work, but it's still an option for some hard-headet like me hahahhahaaa.
    Actualy i didnt pay to much atention on the details while working with photoshop, and still there is an inprovement.
    I know that if there were ''only'' 200-300 frames.. i could do a BIG inprovement on the video using photoshop, but.. the video is around 1 hour long, and ill probably fix only the most important parts of the video.

    p.s. if only i could use some script (avisynth alike), so that i could avoid the manual work.... ehhh...
    Quote Quote  
  5. If you know how to use AVISynth, here is a very advanced script that will make dramatic improvements in VHS and S-VHS (and laserdisc) captures, without introducing massive amounts of new, distracting artifacts.

    The script is mainly intended to kill chroma noise and also the usual residual "snow" seen in most VHS captures. You still need a TBC to get rid of flagging and other time base errors.

    This script uses the modified AVISynth that comes with the multi-threaded (MT) plugin. Thus, if your computer has multi-threading, this script will run VERY fast (I have an eight-core i7).

    I offer this script as is. It works amazingly well, but it is up to you to learn AVISynth (the doom9.org forums are the place to go for that).

    Code:
    #Denoiser script for interlaced video
    Loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools2.dll")
    loadPlugin("c:\Program Files\AviSynth 2.5\plugins\CNR\Cnr2.dll")
    loadPlugin("c:\Program Files\AviSynth 2.5\plugins\MT.dll")
    
    SetMTMode(5)
    #Modify this line to point to your video file
    source=AVISource("E:\Disney Films\Oscars0009.avi").killaudio()
    SetMTMode(2,0)
    chroma=source.Cnr2("oxx",8,16,191,100,255,32,255,false) #VHS
    #chroma=source.Cnr2("oxx",8,14,191,75,255,20,255,false) #Laserdisc 
    
    output=MDegrain2i2(chroma,0,0)
    #stackhorizontal(source,output)
    return output
    
    
    function MDegrain2i2(clip source, int "overlap", int "dct")
    {
    overlap=default(overlap,0) # overlap value (0 to 4 for blksize=8)
    dct=default(dct,0) # use dct=1 for clip with light flicker
    fields=source.SeparateFields() # separate by fields
    super = fields.MSuper()
    backward_vec2 = super.MAnalyse(isb = true, delta = 2, overlap=overlap, dct=dct)
    forward_vec2 = super.MAnalyse(isb = false, delta = 2, overlap=overlap, dct=dct)
    backward_vec4 = super.MAnalyse(isb = true, delta = 4, overlap=overlap, dct=dct)
    forward_vec4 = super.MAnalyse(isb = false, delta = 4, overlap=overlap, dct=dct)
    fields.MDegrain2(super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400)
    Weave()
    }
    Quote Quote  
  6. Member pirej's Avatar
    Join Date
    Mar 2008
    Location
    Macedonia
    Search Comp PM
    Thanks johnmeyer, i'll give it a try.
    I had(have) some other things to do.. so i kind of put my restoration job on ''pause'', but im not giving up
    Thanks again.

    p.s. i did some color sorections experiments vith another video from 1993, but i cant find a avisynth replacement for camcorder color denoise, and here is an example of before and afther.
    The up/left is the original, right/up i virtualdub+tmpenq, and below is first and second try with magix video edit(it supports virtualdub filters, but not the camcorder color denoise )


    sporedba.jpg
    Quote Quote  
  7. Member pirej's Avatar
    Join Date
    Mar 2008
    Location
    Macedonia
    Search Comp PM
    Hi again, yesterday i tried avs script for "restoring old 8mm films" made by videoFred,
    and i'd like to share the result with you.
    This script is not intended for vhs, but.. obviously it works nice if you tweak
    the settings according to you're video source.
    BIG thanks to videoFred and all the others who participated in the making of the script

    Quote Quote  
  8. Looks pretty good. Can you link to videoFred's guide? Did you try out Neat Video?
    Quote Quote  
  9. Member pirej's Avatar
    Join Date
    Mar 2008
    Location
    Macedonia
    Search Comp PM
    Jagabo, im not sure if i am alowed to link to another forum.. so just search on google for "The power of Avisynth: restoring old 8mm films" .
    I have tried Neat Video, its a powerful denoiser, but if you look closer on my screenshot.. you can see that this script kind of "fixed" the tbc error's, and that's probably the most important reason for this improvement, not the denoising part.
    Im not very good at avisynth scripting, but i'll try to findout what part of the script is doing that fixing.
    Quote Quote  
  10. Originally Posted by johnmeyer View Post
    If you know how to use AVISynth, here is a very advanced script that will make dramatic improvements in VHS and S-VHS (and laserdisc) captures, without introducing massive amounts of new, distracting artifacts.

    The script is mainly intended to kill chroma noise and also the usual residual "snow" seen in most VHS captures. You still need a TBC to get rid of flagging and other time base errors.

    This script uses the modified AVISynth that comes with the multi-threaded (MT) plugin. Thus, if your computer has multi-threading, this script will run VERY fast (I have an eight-core i7).

    I offer this script as is. It works amazingly well, but it is up to you to learn AVISynth (the doom9.org forums are the place to go for that).

    Code:
    #Denoiser script for interlaced video
    Loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools2.dll")
    loadPlugin("c:\Program Files\AviSynth 2.5\plugins\CNR\Cnr2.dll")
    loadPlugin("c:\Program Files\AviSynth 2.5\plugins\MT.dll")
     
    SetMTMode(5)
    #Modify this line to point to your video file
    source=AVISource("E:\Disney Films\Oscars0009.avi").killaudio()
    SetMTMode(2,0)
    chroma=source.Cnr2("oxx",8,16,191,100,255,32,255,false) #VHS
    #chroma=source.Cnr2("oxx",8,14,191,75,255,20,255,false) #Laserdisc 
     
    output=MDegrain2i2(chroma,0,0)
    #stackhorizontal(source,output)
    return output
     
     
    function MDegrain2i2(clip source, int "overlap", int "dct")
    {
    overlap=default(overlap,0) # overlap value (0 to 4 for blksize=8)
    dct=default(dct,0) # use dct=1 for clip with light flicker
    fields=source.SeparateFields() # separate by fields
    super = fields.MSuper()
    backward_vec2 = super.MAnalyse(isb = true, delta = 2, overlap=overlap, dct=dct)
    forward_vec2 = super.MAnalyse(isb = false, delta = 2, overlap=overlap, dct=dct)
    backward_vec4 = super.MAnalyse(isb = true, delta = 4, overlap=overlap, dct=dct)
    forward_vec4 = super.MAnalyse(isb = false, delta = 4, overlap=overlap, dct=dct)
    fields.MDegrain2(super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400)
    Weave()
    }

    Hi .... only just read this post .... also read your post elsewhere (10/13/2009) on Filtering Color Noise from VHS Source.
    In that you described uisng CNR VD plugin.

    I have just finished capturing dozens of VHS tapes ...... which of the 2 techniques do you think the better, the script above or the CNR filter.

    Capture was a mixture os S-VHS and VHS PAL tapes via a LTBC into ADVC300
    Quote Quote  
  11. Member pirej's Avatar
    Join Date
    Mar 2008
    Location
    Macedonia
    Search Comp PM
    Originally Posted by pirej View Post
    p.s. if only i could use some script (avisynth alike), so that i could avoid the manual work.... ehhh...
    I didn't give up
    After ~2 years i think i'm close to the result i want, using ONLY avisynth
    I used poisondeathray's script as a good start, and then i added it as a source to some script from Didée that he vrote somewhere on Doom9, i dont know what the script was for originally, but it shore does its magic in my case.
    Not that there is anything that I DID, i just used other's people ideas.
    Thank you.
    p.s. i didn't edit the color's e.t.c., that is yet to come, i was aiming to fixing the tracking "thing".
    p.p.s. the whole script run's at 0.4 fps when encoding to mjepg with virtualdub
    Image Attached Thumbnails Click image for larger version

Name:	compare.jpg
Views:	1103
Size:	62.6 KB
ID:	6769  

    Quote Quote  
  12. great improvements pirej!

    I remember this video - this is a thick defect in the same spot, difficult to treat (not like those transient defects like dropouts, random scratches & lines which are treated quite well by removedirtmc & related filters)

    can you post your current script so everyone can learn?

    thanks
    Quote Quote  
  13. Originally Posted by Tafflad View Post
    Hi .... only just read this post .... also read your post elsewhere (10/13/2009) on Filtering Color Noise from VHS Source. In that you described uisng CNR VD plugin.

    I have just finished capturing dozens of VHS tapes ...... which of the 2 techniques do you think the better, the script above or the CNR filter.
    Over at domm9, they have a policy of not allowing anyone to describe anything as "better." Most of that is to avoid flame wars, but it is also sensible because, when it comes to video, there is most definitely not any one script that is appropriate -- or that even works at all -- for all different video. This is true even when the video is all the same "type," in this case, PAL VHS.

    To answer your question, I'd have to know what specific problems you are trying to address. The script I posted, and which I still use (but which I modify for each and every single tape) is definitely a really good starting point, and it runs very fast in multi-threaded mode. CNR removes the rainbow effects that you get on some really bad EP (6-hour mode) tapes, but is not needed for other tapes. MDegrain2 does a great job on "snow," and the version I posted has been adapted to work with interlaced video.

    Since I posted that script, I have figured out how to do some limited resolution enhancement which helps bring out details in VHS which, of course is only about 320x240. It also helps even with the sharper S-VHS tapes. I also have additions which can help with the chroma offset you get with tapes that have been copied (2nd generation tapes).

    I have many, many other scripts and functions I use (like scripts which detects and removes duplicated or dropped frames and inserts an almost-perfect synthesized frame ... or another script which can remove flashes from still cameras). I can go on, but my main suggestion is that you use my script as a starting point. You'll find that I post, although only once in awhile, over at doom9.org, and you'll find that most of the thread where I post, the discussion is usually about restoration and noise reduction. You should be able to pick up lots of ideas there.
    Quote Quote  
  14. Member
    Join Date
    Dec 2010
    Location
    quebec
    Search Comp PM
    should have an avisynth script-bank here on the forums where we could steal from

    with categories and links to their original threads

    just an idea
    Quote Quote  
  15. Member pirej's Avatar
    Join Date
    Mar 2008
    Location
    Macedonia
    Search Comp PM
    Thank's poisondeathray, this are the scripts, but i didnt tweak anything, so there might be a room for improvement.
    source script
    second script
    edit: this is screenshot of the 2 steps, source=>poisondeathray's script=>Didée's script
    Image Attached Thumbnails Click image for larger version

Name:	compare123.jpg
Views:	1256
Size:	249.8 KB
ID:	6773  

    Last edited by pirej; 10th May 2011 at 08:32.
    Quote Quote  
  16. I have tried the script of johnmeyer a few months back i memory serves well and i didn't find the result very pleasing.The main problem was that it produced some sort of little squares (like macroblocking or microblocking was it perhaps).The video source at the time was a commercial vhs (huff, lossless).
    I'll retry and report out of curiosity
    *** DIGITIZING VHS / ANALOG VIDEOS SINCE 2001**** GEAR: JVC HR-S7700MS, TOSHIBA V733EF AND MORE
    Quote Quote  
  17. Originally Posted by themaster1 View Post
    I have tried the script of johnmeyer a few months back i memory serves well and i didn't find the result very pleasing.The main problem was that it produced some sort of little squares (like macroblocking or microblocking was it perhaps).The video source at the time was a commercial vhs (huff, lossless).
    I'll retry and report out of curiosity
    Every script can produce unwanted artifacts, but I am a little surprised that you got macroblocking with the MDegrain script. Did you use the defaults?

    FWIW, here's my current incarnation of the same script. This includes the ability to remove chroma shifts that happen when you have VHS tapes that are copies of the original. It also includes a sharpening step which seems to help many VHS tapes.

    Code:
    #Denoiser script for interlaced video using MDegrain2
    
    SetMemoryMax(768)
    
    Loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools2.dll")
    LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\CNR\Cnr2.dll")
    
    SetMTMode(5)
    #Modify this line to point to your video file
    source=AVISource("E:\frameserver.avi").killaudio().AssumeBFF()
    SetMTMode(2,0)
    
    #Only use chroma restoration for analog source material
    chroma=source.Cnr2("oxx",8,16,191,100,255,32,255,false) #VHS
    #chroma=source.Cnr2("oxx",8,14,191,75,255,20,255,false) #Laserdisc 
    
    #Set overlap in line below to 0, 2, 4, 8. Lower number=better, but slower
    #For VHS, 4,0 seems to work better than 8,2. Most of difference is in shadows
    #However, 8,0 is good enough and MUCH faster. 8,2 doesn't seem to make much difference on VHS.
    
    output=MDegrain2i2(chroma,8,0,0)
    #stackhorizontal(source,output)
    return output
    
    #-------------------------------
    
    function MDegrain2i2(clip source, int "blksize", int "overlap", int "dct")
    {
    Vshift=2 # 2 lines per bobbed-field per tape generation (PAL); original=2; copy=4 etc
    Hshift=0 # determine experimentally 
    overlap=default(overlap,0) # overlap value (0 to 4 for blksize=8)
    dct=default(dct,0) # use dct=1 for clip with light flicker
    
    fields=source.SeparateFields() # separate by fields
    
    #This line gets rid of vertical chroma halo
    fixed_fields=MergeChroma(fields,crop(fields,Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift))
    
    super = fixed_fields.MSuper(pel=2, sharp=1)
    backward_vec2 = super.MAnalyse(isb = true, delta = 2, blksize=blksize, overlap=overlap, dct=dct)
    forward_vec2 = super.MAnalyse(isb = false, delta = 2, blksize=blksize, overlap=overlap, dct=dct)
    backward_vec4 = super.MAnalyse(isb = true, delta = 4, blksize=blksize, overlap=overlap, dct=dct)
    forward_vec4 = super.MAnalyse(isb = false, delta = 4, blksize=blksize, overlap=overlap, dct=dct)
    
    MDegrain2(fixed_fields,super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400) 
    
    unsharpmask(60,3,0) #not sure whether to put this before or after the weave.
    
    Weave()
    }
    Last edited by johnmeyer; 10th May 2011 at 20:55.
    Quote Quote  
  18. Member Deter's Avatar
    Join Date
    Dec 2007
    Location
    United States
    Search Comp PM
    johnmeyer

    "like scripts which detects and removes duplicated or dropped frames and inserts an almost-perfect synthesized frame"

    Was wondering how this works, from time to time I find duplicate frames and to remove I do it manually...Which Sucks

    This is the normal problem that I see:
    1-2-3-4-5-6-7-8-9-10-11-10-11-12-13-14

    So what you get is like a skipping effect...

    When I remove them manually, pull out 2 frames and the audio for those two frames....

    (Which 100% Fixes that problem)

    However in order to pull out those frames u have to find them....aka a lot of time & work....

    A script would be a lot easier if it worked, on this type of problem.....

    "inserts an almost-perfect synthesized frame"

    From time to time you get damaged frames in a video.

    If you remove them and the scene in the video has motion ????

    You create a jitter effect in the video, which doesn't look natural or good.

    On avg. I would say 1 or 2 frames it is pretty easy to manually fix...

    4 frames is about the limit

    7 or more is usually a problem.......

    Any help on this ?

    (Have a few ways to restore frames, normally have to re-paint or edit those damaged frames)
    Last edited by Deter; 10th May 2011 at 21:15.
    Quote Quote  
  19. I've tried this script it again with a vhs rip.
    The denoising is too agressive a few drawings on some t-shirts tend to "magically" disappear.The chroma denoising seems great though.I think you should stick to denoise the chroma plane that's the feeling i get after i tried many denoisers,Neatvideo & fft3dfilter among others things.
    Edit:
    Oh i have forgotten ..the blocking i found it again
    original:

    script result:
    Last edited by themaster1; 10th May 2011 at 23:41.
    *** DIGITIZING VHS / ANALOG VIDEOS SINCE 2001**** GEAR: JVC HR-S7700MS, TOSHIBA V733EF AND MORE
    Quote Quote  
  20. One of the gurus over at doom9 created a script which synthesizes a frame to replace a duplicate frame. He wrote it for progressive video, and it used the older MVTools. I changed it so it works with interlaced video and uses the new MVTools2. I wrote it as an AVISynth function. As you see in the comparison line, this will actually replace a frame even if it isn't an exact duplicate. If you only want to replace perfectly exact duplicates (which are often created by capture cards when they drop a frame), then you can set the comparison values to zero.

    Code:
    function filldropsI (clip c)
    {
      even = c.SeparateFields().SelectEven()
      super_even=MSuper(even,pel=2)
      vfe=manalyse(super_even,truemotion=true,isb=false,delta=1)
      vbe=manalyse(super_even,truemotion=true,isb=true,delta=1)
      filldrops_e = mflowinter(even,super_even,vbe,vfe,time=50)
    
      odd  = c.SeparateFields().SelectOdd()
      super_odd=MSuper(odd,pel=2)
      vfo=manalyse(super_odd,truemotion=true,isb=false,delta=1)
      vbo=manalyse(super_odd,truemotion=true,isb=true,delta=1)
      filldrops_o = mflowinter(odd,super_odd,vbo,vfo,time=50)
    
      evenfixed = ConditionalFilter(even, filldrops_e, even, "YDifferenceFromPrevious()", "lessthan", "0.1")
      oddfixed  = ConditionalFilter(odd,  filldrops_o, odd,  "YDifferenceFromPrevious()", "lessthan", "0.1")
    
      Interleave(evenfixed,oddfixed)
      Weave()
      AssumeFieldBased()
      AssumeBFF()
    }
    Quote Quote  
  21. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by johnmeyer View Post
    Code:
    function filldropsI (clip c)
    { ...
      AssumeFieldBased()
      AssumeBFF()
    }
    Please, not again! Those last two lines should not be there.

    I've told you this several times on Doom9. Each time you correct it, but it keeps coming back.
    Quote Quote  
  22. Wow, you follow me around the Internet correcting my work! It's like having my high school English teacher, Mrs. King, rapping my knuckles each time I use "their" instead of "there."

    I do, however, feel sheepish about this, and I just spent five minutes doing a global search on every AVS file on my main computer, searching for "filldrops," then opening the script, and looking for the offending lines. Most of them were purged after our last discussion, but I did find a few (including the one I grabbed for this post), that still had the offending lines. Now I just need to remember to propagate this to my laptop.

    FWIW, I always found that the script worked fine, even with these lines included.
    Quote Quote  
  23. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Sorry if I sounded like a schoolteacher John, but (like Mrs King ) I hate to see mistakes propagated.
    (And obviously I'm not following you, we just happen to frequent the same places.)

    Originally Posted by johnmeyer View Post
    FWIW, I always found that the script worked fine, even with these lines included.
    Yes, the function itself works, but (as I previously explained ) wrongly marking the clip as field-based can lead to problems further on in the script. For example, a later use of SeparateFields() would raise an error, and some other filters behave differently depending on whether their input is field-based or frame-based. I believe it may even affect the behaviour of some encoders (eg x264 will encode each frame as a field).
    Quote Quote  
  24. In keeping with the Mrs. King theme:

    I promise it will never happen again.
    I promise it will never happen again.
    I promise it will never happen again.
    I promise it will never happen again.
    I promise it will never happen again.

    Quote Quote  
  25. Originally Posted by Deter View Post
    This is the normal problem that I see:
    1-2-3-4-5-6-7-8-9-10-11-10-11-12-13-14
    This pattern is problematic, and won't be detected automatically. Neighboring dupes can be auto detected, e.g. 10-10, but AFAIK think this type of sequence 10-11-10-11 will not be detected.

    You can still use mflowinter to treat this - but manually finding them - and it will still save you many hours over photoshop or AE. Even if the generated frames aren't perfect, it gives you a starting point to fix and you're still way ahead compared to doing it completely from scratch .

    IMO gaps in audio are much more difficult to treat than video. I would generate a 10.5, and a 11.5 to insert, so it would go 9-10-10.5-11-11.5-12 . There will be slight desync over 2 frames, but hardly noticable, and probably better than a straight dupe, or a straight blend.

    From time to time you get damaged frames in a video.

    If you remove them and the scene in the video has motion ????

    You create a jitter effect in the video, which doesn't look natural or good.

    On avg. I would say 1 or 2 frames it is pretty easy to manually fix...

    4 frames is about the limit

    7 or more is usually a problem.......

    Any help on this ?

    (Have a few ways to restore frames, normally have to re-paint or edit those damaged frames)

    Again, mflowinter is the base function. The script John posted is for auto dupe detection & replacement, not damaged frames. I don't think "auto" damaged frames detection is possible with any accuracy. It would remove some good frames (e.g. like an explosion sequence) . There is no dependable way to determine if a frame is damaged, except with human eyes. Dupes however, can be detected.

    Most of the time mflowinter does a decent repair on scenes with low or predictable linear motion. The more drastic the vectors it has to interpolate (e.g. explosions, action sequences, non linear motion like water ripples), the more problems and side effects like weird edge dragging and morphing. Strings of bad frames are problematic too - you need to have neighboring "good" frames to interpolate the information from. So in your above example, a "10.5" and a "11.5" should be possible.

    If you want to see a recent example, download this A/B mp4 compare video in this post. If you step through frame by frame, you will notice frames 4 & 5 are heavily damaged, but the interpolated frames are fairly good quality (not dupes or blends)
    https://forum.videohelp.com/threads/334613-Filters-for-restoring-old-VHS?p=2077097&view...=1#post2077097

    It would be great if someone came up with a helper function that accepted a text file listing bad frame numbers, and the function would auto repair those frames. I think found some threads where this was attempted but can't get any of them to work properly. (Maybe Gavino or John will attempt to write such a function )
    Last edited by poisondeathray; 11th May 2011 at 13:47.
    Quote Quote  
  26. We had a similar discussion over at doom9, about how to remove dupes when the duplicates and the skip (the missing frame that was replaced by the duplicate) do not happen on adjacent frames.

    http://forum.doom9.org/showthread.php?t=160623&highlight=conditional

    I am pretty certain that it can be done with conditional logic in AVISynth, but as we discussed in the doom9 thread, conditional logic in AVISynth is rather difficult to deal with, and I didn't have the time to do it. Since I have had this problem before, the next time I have to deal with it myself I guess I will finally get around to trying to solve the problem. If I do, I'll post the result.

    As for the particular pattern that you posted, I dealt with something similar in another thread over at doom9:

    http://forum.doom9.org/showthread.php?t=161182

    and found that the problem could be solved by dealing with the video at the field level. I merely reversed all fields, and the video looked OK (to me). The key point I'm trying to make is that you always need to look at the video field-by-field (by running it through a one-line AVISynth script that has nothing except the "separatefields()" statement). This is the only way to tell what is really going on.

    I don't think "auto" damaged frames detection is possible with any accuracy.
    I have written several AVISynth scripts that can do a pretty good job at this. I wrote it because I wanted a way to "flag" any frame at which a photographer's flash went off. I then replaced that single bad frame with an interpolated result. The script that does this is actually pretty simple. You can do it any number of ways, but the key thing is to look for a frame which is VERY different from BOTH of its neighbors. This is different from a scene change, where the preceding frame is quite similar to the current frame; only then next frame is different.
    Last edited by johnmeyer; 11th May 2011 at 14:06. Reason: Added reply to the other poster (about damaged frame detection) one minute after post
    Quote Quote  
  27. Here is the key line from one of several AVISynth scripts I wrote for detecting "unique" frames (i.e., frames which are significantly different from both the previous and next frames:

    WriteFileIf(i, filename, "(Averageluma(i) - Averageluma(j)< -blankthreshold)&&Averageluma(j) - Averageluma(k)>blankthreshold", "int((current_frame/2))+1", append = false)
    Quote Quote  
  28. Yes definitely examine at the field level, that's what helped to determine Mounir's example in your 2nd link was actually progressive content, just telecined. But Deter's sequence is definitely not that

    I like to see what comes out of the conditional logic development


    Here is the key line from one of several AVISynth scripts I wrote for detecting "unique" frames (i.e., frames which are significantly different from both the previous and next frames:

    WriteFileIf(i, filename, "(Averageluma(i) - Averageluma(j)< -blankthreshold)&&Averageluma(j) - Averageluma(k)>blankthreshold", "int((current_frame/2))+1", append = false)

    I'm not much of a coder - Is this is for N +/- 1 ? direct neighbors ?


    Quote Quote  
  29. I was thinking along the lines of dedup(), where the 1st pass is a detection pass, and it writes a log file.

    But instead of decimating the dupes on the 2nd pass, using mflowinter to interpolate the frame. I have no idea how to write that or if it's even possible

    But even if a helper function was coded, where mflowinter would accept a text file (and you manually listed the bad frames) that would be useful IMO
    Quote Quote  
  30. Originally Posted by poisondeathray View Post
    I was thinking along the lines of dedup(), where the 1st pass is a detection pass, and it writes a log file.

    But instead of decimating the dupes on the 2nd pass, using mflowinter to interpolate the frame. I have no idea how to write that or if it's even possible

    But even if a helper function was coded, where mflowinter would accept a text file (and you manually listed the bad frames) that would be useful IMO
    Several years ago, I posted at several places about how I used TFM/TDecimate to remove both redundant as well as blended frames that resulted from capturing video from a movie projector from which the shutter had been removed. During the process of figuring out how to correctly decimate the resulting capture, I did almost exactly what you describe: I did the first pass to identify what needed to be removed and created an output file from that result. I then "massaged" that file and created (using some Excel macros, in my prototype) an input file to pass two. Here is the relevant line from the first pass:

    Code:
    tfm(display=false,micout=2,mode=0,cthresh=45,mi=120,pp=1,metric=0,field=1,sco=-1,micmatching=2,slow=2,output="e:\tfm.txt")
    The result of massaging the tfm.txt file was a file called "input.txt." This next line shows how that was used in pass 2:

    Code:
    tfm(display=false,input="E:\film\input.txt")
    MultiDecimate(pass=2)
    So, the actual decimation process is actually quite simple once you create the list of duplicates.

    ...

    Ah, I can't believe it, but I still have an old input.txt file on this laptop (from 2006!). Here are a few sample lines:

    Code:
    #TFM v0.9.12.2 by tritical
    field = top
    
    0 c -
    1 c -
    2 n -
    3 n -
    4 n +
    5 c -
    6 c -
    7 n -
    8 n -
    9 n +
    10 c -
    I'd have to go back to the documentation to see what this means. However, as I remember, there is an even easier way to specify which fields should be decimated (this all needs to be handled at the field and not the frame level.)
    Quote Quote  



Similar Threads

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