VideoHelp Forum


Try DVDFab Video Downloader and rip Netflix video! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. Hello, I have two VCR's which I've recorded the same tape. One VCR produces significantly better quality but drops out to a blue frame randomly, the other has lower quality and doesn't. I have both captured to .MP4 files with OBS. I cleaned both VCR's heads and tape handling poles before recording.

    I'm looking for a way to automatically detect and remove all blue frames from the video and replace with the lower quality frames of the other video that didn't drop out.

    I initially thought to use Davinci Resolve to manually cut all the blue frames for the lower quality video under to show in it's place, but as I was recording more videos it quickly became apparent this would take a long time for all the videos I have and number of drop outs per video. Perhaps it could still be possible using Davinci's Fusion, but I haven't found any leads on any method.

    I've read a bit about using AVISynth to remove duplicate frames, perhaps using this plugin http://akuvian.org/src/avisynth/dedup/ but I don't think that'd allow me to then replace the missing video.

    Does anyone have any advice for this type of scenario in proceeding with AVISynth or any other method?

    Thanks
    Quote Quote  
  2. Member
    Join Date
    Nov 2006
    Location
    United States
    Search Comp PM
    Stupid question for you; does your vcr have TBC?
    Quote Quote  
  3. Or If the two videos are perfectly in sync it's pretty easy to sub the blue frames with a frame from the other video in AviSynth. If the blue frames are truly random (ie, different every time you play the tape) you can capture the tape 3 times and use a median filter in AviSynth. Samples are required.
    Quote Quote  
  4. First, have you looked at the menus on the VCR which outputs blue screen when the signal is degraded? Most camcorders and video decks (VCRs) have the ability to turn off the blue screen, so you can watch the snowy or corrupted signal.

    That would be my first recommendation.

    It is fairly trivial to find and then delete frames that are blank. This script finds all frames that are completely blank and outputs the frame numbers. You then feed this list of corrupt frames to FDecimate (or similar decimation filter) and that will remove all those frames.

    All you need to do is change the AverageLuma() comparison to one that identifies frames that are uniformly blue.

    Code:
    #Script to find blank frames
    
    #Specify the name and location of the output file
    filename = "e:\output_blank_frames.txt"
    global blankthreshold=25
    
    #Use one of the following to specify the name and location of your video file
    
    AVISource("E:\fs.avi").killaudio().ConvertToYV12()
    
    #Get rid of the border garbage on analog captures 
    Crop(16,16,-16,-16)
    
    # Use the following to reduce the number of fields by 50% in order to speed processing
    i=AssumeBFF.separatefields.selectodd
    j=trim(i,1,0) #Previous frame
    
    # Temporarily un-comment next line to display the average luma value on screen to help determine threshold value
    #ScriptClip(i,"Subtitle(String(AverageLuma(i) ))" )
    
    #This line below will output EVERY frame that is below threshold, which results in LOTS of frames
    #Normally you don't do this, but it is included for those who want this capability.
    #WriteFileIf(last, filename,  "(AverageLuma(i)<blankthreshold)", "current_frame+1", append = false)
    
    ##This is the line that actually writes the frame number of the FIRST frame that falls below the threshold
    WriteFileIf(last, filename,  "(AverageLuma(i)<blankthreshold)&&AverageLuma(j)>blankthreshold", "current_frame+1", append = false)
    
    #The line below finds the LAST blank frame. 
    #WriteFileIf(last, filename,  "(AverageLuma(i)>blankthreshold)&&AverageLuma(j)<blankthreshold", "current_frame+1", append = false)
    
    #When all finished, write the end of file marker
    #WriteFileEnd(last, filename, """ "Now the script is closed" """)
    Quote Quote  
  5. Hello, thanks for all the replies.

    Neither VCR has a TBC function as far as I can tell. They're relatively cheap VCRs.

    The blue frames do occur at the same times when playing back the videos.

    I got a remote for the VCR that has the blue frame issue (Sanyo VWM-710) but it doesn't seem to have the ability to stop the blue frame. It does have a tracking function, so I may redo some of the recordings. Perhaps with better tracking the blue frames wont be triggered as much.

    In regard to AVISynth, I want to find and replace blue frames with frames from the other recording. I can edit both videos to be the same time if that's necessary.
    The audio continues when it goes to the blue frame.
    Quote Quote  
  6. Replacing the blue frames is the easy part. The AviSynth script will look something like:

    Code:
    blues = LWLibavVideoSource("blueframes.avi")
    alternate = LWLibavVideoSource("alternate.avi")
    detect = MaskHS(v0, StartHue=349, EndHue=352, MinSat=90, MaxSat=150) # detect blue frames as brightness
    
    ConditionalFilter(detect, alternate, blues, "AverageLuma()", "greaterthan", "200")
    Getting the two videos with similar brightness and colors, and aligned over an entire recording, is probably going to be harder.
    Quote Quote  
  7. jagabo, thanks for that script. It may not help the OP, but I didn't know how to build a mask from a range of hues. That one MaskHS line will be very useful code for me. I didn't even know MaskHS existed. I guess it is part of AVISynth+, which I do use most of the time now.
    Quote Quote  
  8. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    The fix for this is a quality capture, with a quality VCR.

    This attempt at a Avisynth fix is a crutch that won't actually work. It'll be disjointed, and quality will be lousy.

    I question whether it had dropped frames -- extremely likely.
    Quote Quote  
  9. Originally Posted by johnmeyer View Post
    I didn't know how to build a mask from a range of hues. That one MaskHS line will be very useful code for me. I didn't even know MaskHS existed. I guess it is part of AVISynth+, which I do use most of the time now.
    MaskHS() has been around for a long time, long before AviSynth+. Here's a little animated demo to play with...
    Image Attached Files
    Quote Quote  
  10. You're right. I just looked at the changelogs and it was added in Version 2.6.0. I just missed it.
    Quote Quote  



Similar Threads