VideoHelp Forum
+ Reply to Thread
Results 1 to 17 of 17
Thread
  1. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Attached is a sample.

    An ugly, interlaced, 8mm>VHS capture.

    Challenge: What is the best that you can do to remove all the blending, and recover the original frames?

    Note that the actual fps is unknown (though can probably be tabulated manually), anything in 14-24 range was possible. But the output here should probably be 24fps, for standards reason.

    I tried my best. Not bad. But I want to see if anybody can do better. (So as not to influence you, I'm not yet posting my script. But please do post yours, so I can run it myself on the much longer full video, see if it's viable.)
    Image Attached Files
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  2. It looks like a case of bad telecine rather than a bad transfer.

    To undo well-done telecine, you can use TFM/TDecimate as follows:

    Code:
    tfm(display=false)  
    tdecimate(display=false,mode=0,cycleR=2,cycle=5) #18 fps  # 3:3:4 field count
    #tdecimate(display=false,mode=0,cycleR=7,cycle=15)#16 fps
    For bad telecine, SRestore is what you want to use. I don't have time now to try it out on your clip. My guess is that this will be what ends up working the best. You might try looking at this post which, while dealing with a slightly different film transfer issue, will give you some hints on using SRestore for this sort of operation:

    How to de-interlace 25i coming from 8 mm film transfer

    Finally, for film which was badly transferred by using a non-frame-accurate transfer system, this guy developed some tools that work really well (I've actually used them):

    The power of Avisynth - salvaging "botched" transfers of old 8mm films to DVD.

    He describes, in his 3rd or 4th post (he made multiple initial posts), exactly what situation his software is designed to fix.
    Quote Quote  
  3. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Originally Posted by johnmeyer View Post
    I don't have time now to try it out on your clip.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  4. Member
    Join Date
    Dec 2005
    Location
    Finland
    Search Comp PM
    Here's a quick test with SRestore():

    Code:
    AssumeTFF()
    QTGMC()
    
    SRestore(frate=18.4777)
    MP4 encoded version included as attachment. Of course this leaves the clip at an odd frame rate, but you could for example AssumeFPS(18) and then convert to 24 with your preferred method.
    Image Attached Files
    Last edited by ajk; 9th Sep 2020 at 11:02. Reason: Cleaned up script
    Quote Quote  
  5. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    How was the odd fps calculated?
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  6. You can count unique positions of moving objects and compare to total frames (over a particular sequence). Then calculate the frame rate as:

    Code:
    base frame rate = framerate * unique positions / total frames
    After QTGMC there are 132 frames at 59.94 fps. I counted 41 unique motion positions.

    Code:
    base frame rate = 59.94 * 41 / 132 ~= 18.6
    ajk may have counted a shorter sequence, hence the slightly different value.
    Quote Quote  
  7. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Ah, okay, so it is manual.

    I'm trying ajk's script now. I still see a random blended frame at times, but very infrequently now.

    Can the 18+fps just be opened in the john/fred script, and let it output to 24fps?

    I'm on another system now, can't access exact script. What I had done was a stacked TFM(), slightly different settings on each, followed by an srestore to 24fps. It worked amazingly well on the film where I wrote it, but this one was imperfect.

    I still want to read johnmeyer's links above sometime soon, will bookmark for later reading.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  8. Member
    Join Date
    Dec 2005
    Location
    Finland
    Search Comp PM
    Yeah, should have mentioned that earlier but I was in a hurry. Exactly as jagabo said, I counted the number of what I considered clean frames and calculated the true frame rate based on that.

    Of course counting all frames is impractical in a general case, but 100 or so frames goes quickly and should get you close. If the frame rate fluctuates, of course some blended frames might still get through here and there. There isn't really a good solution for that, except dividing the footage into small enough sections and figuring out the frame rate for each.

    I haven't used the film restoration script myself, but I don't see why you couldn't do the decimation separately like this and then run it.
    Quote Quote  
  9. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Which decimate filter (inverse decimate operation?) would you suggest to go back to 24fps?

    In fact, it's been so long since I ran one, years, that I can't even think of the needed syntax. So suggestion for that would be equally appreciated.

    john ... you there? What do your/fred's script do? (I guess I need to read it line by line again, it may be obvious.)
    Nevermind. The script just reads the fps, it doesn't convert. So I definitely need to convert back to 24 before that script is run.
    Last edited by lordsmurf; 9th Sep 2020 at 14:37.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  10. I don't think QTGMC is necessary. I played around with your clip and this script seems to fix it 100%.

    Code:
    loadPlugin("C:\Program Files\AviSynth 2.5\plugins\Srestore\mt_masktools-25.dll")
    Import("C:\Program Files\AviSynth 2.5\plugins\Srestore\srestore.avs")
    AVISource("E:\fs.avi").KillAudio().converttoYV12(interlaced=true).AssumeTFF()
    bob(-0.2,0.6)
    srestore(frate=18, omode=6)
    I have attached the resulting output.
    Image Attached Files
    Quote Quote  
  11. Originally Posted by lordsmurf View Post
    Which decimate filter (inverse decimate operation?) would you suggest to go back to 24fps?

    In fact, it's been so long since I ran one, years, that I can't even think of the needed syntax. So suggestion for that would be equally appreciated.

    john ... you there? What do your/fred's script do? (I guess I need to read it line by line again, it may be obvious.)
    Nevermind. The script just reads the fps, it doesn't convert. So I definitely need to convert back to 24 before that script is run.
    My script (above) gives you an 18 fps result. This will be correct if the original was Super 8. If the original was regular 8mm or if it is 16mm silent film, the motion may be too fast. Run the script on a sample, and if the motion looks too fast, then add:

    AssumeFPS(16)

    to the end of the script above. Most amateur 8mm and 16mm film from 1940 onward is 16 fps, although there are exceptions.

    Then, if you are going to use VideoFred's script, or my variations on his script, set:

    play_speed=16

    (or set it to 18 if you determine that is the correct speed).

    It is important that you set play_speed to match the fps in the video you feed into the film restoration script.
    Quote Quote  
  12. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    You're right, I don't think QTGMC is needed either. Your bob looks great!

    But the film is definitely not 18fps. Even with the omode set, too many blurs left. It's definitely somewhere between 18.4 and 18.6, and I think 18.4777 is pretty close. The projector was probably too fast.

    So:
    Code:
    bob(-0.2,0.6)
    SRestore(frate=18.4777)
    AssumeFPS(18)
    But how to convert to 24fps next? (I can't believe I've forgotten so much in the past few years. )
    EDIT: ChangeFPS(24) ?

    AssumeFPS means I'll have to tweak the audio narration. But it does look more correct motion-wise.
    Last edited by lordsmurf; 9th Sep 2020 at 16:02.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  13. You set the "frate" variable in SRestore to whatever number is needed to remove the blends. I doubt very much it needs to be that oddball rate. The frate variable changes how many fields are blended and/or deleted, and that is the ONLY thing you should be thinking about when choosing that number.

    Once you have recovered the original frames, which it appears from your sample this script will do, THEN you set the playback speed using AssumeFPS. All that AssumeFPS does is to change how fast the playback software plays the video. It is exactly like the speed control on a film projector where, when you increase the speed, the film plays faster, but no frames are added or deleted. It is the same with AssumeFPS: it neither add, deletes, or blends frames (unlike ChangeFPS), but simply tells the media player how fast to play the frames.

    The way I came up with 18.000 as the number is the same as what was already described: I used a one-line AVISynth script consisting of separatefields() and nothing else (I never trust bob to do the right thing, because to get a simply field to frame conversion with bob you have to remember to use the correct syntax, and I can never remember what to use). Then, while walking through field by field, count every time you see an image from the next frame many of these will be blended, so you have to have your wits about you to not miss a count and not double count.

    That's how I came up with frate=18.

    As for audio, I assume, given how the film looks, that it is silent film, and the narration is something you or a family member added. I have done lots of voice overs, where I have family member watch the video transfer while I record their voice, and then later add that to the film transfer. Their audio does not have to be "frame-perfect." As a result, while you can speed up or slow down the narration (using pitch correction so the voices still sound normal), you could also simply edit out pauses in the narration (or add "silence" consisting of blank parts of the original narration) in order to get each section of the narration close enough to the original audio placement so it tracks what is being shown.
    Quote Quote  
  14. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Yes, I know most of theory.

    Syntax is my main issue, always has been. And then Avisynth is such a large crowdsourced project (and before the word "crowdsource" even enter our lexicon), there are often options to filters. And I just don't keep up with everything regularly anymore, hence soliciting suggestions on what to use.

    I think I'll run with bob() instead of QTGMC(), srestore() to the faster-than-18, assumefps(18), and clean. Then output 2nd version from post-clean, with changefps(24) to make it BD complaint.

    This is slightly better than my previous (recycled) method, so I'm glad I asked here.

    Thank you all for the suggestions and scripts.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  15. I agree with your decision to not use QTGMC. It actually is a very bad choice for this because SRestore is already doing motion estimation, and you don't want to do that twice. Also, unless you know the QTGMC variables, you will probably end up having it do noise reduction, which you most definitely do NOT want to do, given that you are going to be using a restoration script later on. Finally, QTGMC is extremely slow, and since it adds absolutely nothing to this particular operation, whey have things take longer than they need to?
    Quote Quote  
  16. Member
    Join Date
    Dec 2005
    Location
    Finland
    Search Comp PM
    Please don't read too much into my use of specifically QTGMC; it was simply my first choice for smart bobbing as it keeps the aliasing and shimmering down. A dumb bob is certainly appropriate for a source like this. The main objective here was to try out SRestore on the footage.

    As for SRestore, it isn't based on motion estimation. It detects which frames are blends and replaces them with the corresponding clean frames, then optionally decimates to leave only the original frames at the original frame rate (at least, ideally). There is a double-blend option where SRestore will reconstruct a frame that only exists in the source as blends, but this is not based on motion estimation either. In any case, as long as one can determine the true source frame rate accurately enough, SRestore does a very nice job with this sort of material
    Quote Quote  
  17. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    These days, I think we jump to QTGMC too much. I know I'm guilty of it. It is the best deinterlacer, generally. And does the best job, generally. But not always. And I'm glad johnmeyer caught it here.

    Just FYI, I've also added LSFmod(), along with nnedi3_rpow2(). I just don't like the scaling and sharpening done by the john/fred film clean script (and commented it out there), and think it's another area that could use improvement. Or rather, better file prep (what I'm doing now) before feeding it to that script.
    Last edited by lordsmurf; 10th Sep 2020 at 04:52.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  



Similar Threads

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