VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 21 of 21
Thread
  1. Member goodiesguy's Avatar
    Join Date
    Sep 2011
    Location
    New Zealand
    Search PM
    I have AVISynth and AvsPmod, and I want to restore 16mm kinescopes, the source is DVD (someone's uploaded YouTube clip of the exact 16mm footage I'm trying to restore (Sorry it wont let me hyperlink for some reason: https://www.youtube.com/watch?v=GcL8yeFss0o)

    Currently using FILM9 for Grain and Dirt Removal, but would be happy to move away from it.

    I wish to do the following:
    - IVTC correctly to get back the film frames from the Interlaced VOB's/Mpeg-2 on the DVD's (been playing around in VirtualDub but unsure if I'm doing correctly)
    - Remove Grain and Dirt (currently done in FILM9)
    - Remove Film Gate Weave (I've tried everything, including some AviSynth scripts, but they all have the same issue, if a person for example, moves of bobs up and down, it causes the stabilization to lock on to that and the whole picture moves, instead of getting rid of the gate weave.)
    - Motion Interpolation/VidFIRE, been playing around with the script documented here: https://www.vegascreativesoftware.info/us/forum/24p-to-60i-kinescope-restoration-and-more--68296/ but that is for NTSC stuff. I thought I had got it to work with PAL, at least I did the other day by changing "source=assumefps(23.976).assumeframebased" to "source=assumefps(25.000).assumeframebased" which seemed to give me good results, but Tonight it doesn't seem to want to work, giving me a 29.97 result, which is causing interlacing issues when the saved avi from VirtualDub is in Sony Vegas (in the DV PAL mode), the encodes are not correctly interlacing for some reason, though it's been a long day and I'm tired, so I very well could work this issue out myself.

    Currently a Bachelor of Information Technology student, in the beginnings of learning C#, so while this has helped me understand bits and pieces and for the first time try AviSynth (eg: recognising similarities with the scripts to aspects in C#), a lot of it's still confusing as heck to me, but I'm willing to learn if anyone can help.

    I can provide video samples of issues I'm facing if needed. Thanks in advance for any help given, I'm a beginner, but really keen to delve into the power of AviSynth
    Quote Quote  
  2. Originally Posted by goodiesguy View Post
    I can provide video samples of issues I'm facing if needed.
    Samples should always be provided, without even asking if they're needed. And YouTube samples are pretty much useless. If DVDs are your sources, then the samples should be untouched from the DVD, 10 seconds or so. You can cut M2Vs using DGIndex. You should be familiar with that very important utility if working with DVDs and AviSynth.

    johnmeyer, who authored that link, will probably also see your post and take an interest.
    Quote Quote  
  3. Originally Posted by goodiesguy View Post
    - IVTC correctly
    TFM().TDecimate(mode=, rate=, etc)

    Originally Posted by goodiesguy View Post
    - Remove Grain and Dirt (currently done in FILM9)
    Or you could use alternates like TemporalDegrain(), MCTemporalDenoise(), etc.

    Originally Posted by goodiesguy View Post
    - Remove Film Gate Weave
    Stab()

    Originally Posted by goodiesguy View Post
    - Motion Interpolation
    I'd advise against this as it's just going to create motion artifacts. But if you must there are several alternatives in AviSynth based on mvtools and derivatives.
    Quote Quote  
  4. Member goodiesguy's Avatar
    Join Date
    Sep 2011
    Location
    New Zealand
    Search PM
    Originally Posted by jagabo View Post
    Stab()
    I've looked at the script provided here: http://avisynth.nl/images/Stab.avsi , but I'm unsure where to link to my AVISource. The wiki: http://avisynth.nl/index.php/Stab gives me an example of:

    AviSource("Blah.avi")
    Stab(range=1, dxmax=1, dymax=1, mirror=0)

    But I'm not sure how I would place this into the script. Still learning this whole Script stuff, so just trying to figure things out.
    Quote Quote  
  5. Member goodiesguy's Avatar
    Join Date
    Sep 2011
    Location
    New Zealand
    Search PM
    Originally Posted by jagabo View Post
    TFM().TDecimate(mode=, rate=, etc)

    Or you could use alternates like TemporalDegrain(), MCTemporalDenoise(), etc.
    Will do some googling around and see what I can learn.
    Quote Quote  
  6. Member
    Join Date
    Jan 2007
    Location
    Republic of Texas
    Search Comp PM
    No, no no! No IVTC! You are working with an Australian KINESCOPE (film shot from a video monitor) of a PAL (25fps) TV show, shot on 25fps film, transferred back, presumably, to PAL 25fps video. Everything should already be frame-by-frame, with no repeated frames. (I could not download the video to confirm the frame rate, but there is no indication that it went to NTSC.) You do not want a 60i output, but rather 50i, right? Unless you purposely want it for NTSC playback. (You were unclear on that. If that's the case, we'll go through better PAL to NTSC procedures.)
    Quote Quote  
  7. We're still waiting for a sample of the DVD MPEG 2 data.
    Quote Quote  
  8. I've done a lot of work with Kinescopes. If you look at the Wikipedia article about it you'll find out by reading what I have found out by experience: every Kinescope is different, and there is no single way to restore or improve them. Thus, the only way to provide any advice is to get 10-15 seconds (minimum) of original video, not YouTube and not a copy.

    If you can get Film9 to work, more power to you. It would not be my first choice.

    The most important thing is to make sure that all field repeats -- if they even exist -- are removed, and that any ghosting is reduced. IVTC may be the right tool for this, but it may be useless. Again, there are so many different ways that Kinescope was done that there is no hard and fast rule for dealing with this. I have a potential client who just sent me a Kinescope that is going to require all sorts of custom software to recover because there is a moving line that moves down the picture that is a discontinuity created during the blanking interval with at least two scan lines missing. I need to track the moving line, interpolate the missing fields, and insert them. I know how to do all those things, but it will be a challenge to write the software and make it work. However, the Kinescope is in really good shape and is a professional first-generation transfer, so the result will be gorgeous, if I can do it.

    So, I cannot help you unless you can post a first-generation clip of the material you are trying to improve.
    Quote Quote  
  9. Member goodiesguy's Avatar
    Join Date
    Sep 2011
    Location
    New Zealand
    Search PM
    Originally Posted by jagabo View Post
    We're still waiting for a sample of the DVD MPEG 2 data.
    Will provide shortly, just woke up (7am here)

    Originally Posted by filmboss80 View Post
    No, no no! No IVTC! You are working with an Australian KINESCOPE (film shot from a video monitor) of a PAL (25fps) TV show, shot on 25fps film, transferred back, presumably, to PAL 25fps video. Everything should already be frame-by-frame, with no repeated frames. (I could not download the video to confirm the frame rate, but there is no indication that it went to NTSC.) You do not want a 60i output, but rather 50i, right? Unless you purposely want it for NTSC playback. (You were unclear on that. If that's the case, we'll go through better PAL to NTSC procedures.)
    Probably should've been more clear, I want everything kept at PAL at all times.
    Quote Quote  
  10. Member goodiesguy's Avatar
    Join Date
    Sep 2011
    Location
    New Zealand
    Search PM
    Here's a file.
    Image Attached Files
    Quote Quote  
  11. It's PAL video, 720x576, 25 fps. There are no comb artifacts and every frame is already unique. So there's no need for any field matching or decimation.
    Quote Quote  
  12. That's a really nice, clean kinescope. Since it is 25 fps and since you will be creating a 25 fps result, this is very simple to deal with. You can use any of VideoFred's film restoration scripts (or my variations). They are posted at doom9.org in these two threads:

    The power of Avisynth restoring old 8mm films

    Capturing and restoring old 8mm films


    Here is the result of running your clip through my heavily-modified version of VideoFred's original script:

    Bandstand.avi

    I cropped the edges a little too much because I needed to crop before applying motion stabilization (to get rid of the film gate weave). It is possible to do the restoration without this excessive crop, but I didn't have time to re-write the code.

    I was able to eliminate most of the dirt, and reduce the film grain, so that it looks more like video. I did not take the extra step of converting from 25p to 50i (i.e., back to PAL interlaced), but I could certainly do that. I could also change it to 50p (i.e., 50 full frames a second, non-interlaced). Either 50i or 50p would give it much more of a video "feel," and make it look much more like the original video broadcast.

    The one thing I am not able to do is remove the scratches. Film scratches are very tough to deal with because, unlike dirt where each spot only happens on one frame, the scratches will often persist for dozens or hundreds of frames. If they stayed in exactly the same point, I still might be able to remove them but, unfortunately, they tend to wander back and forth. There are scratch removal filters for both VirtualDub and AVISynth, but in my experience they don't work well enough to make it worth the time to play around with them.

    So, take a look at my result, and if you want to proceed to do something similar, skim through those two long posts. The answers to all your questions about film restoration will be answered there, but be prepared to spend some time reading.
    Last edited by johnmeyer; 27th Mar 2017 at 18:24. Reason: Bad URL
    Quote Quote  
  13. A quick example:

    Code:
    Mpeg2Source("bandstand.demuxed.d2v", CPU2="ooooxx", Info=3) # deringing, no deblocking
    Crop(16,0,-0,-0) # remove some of the black border on the left
    RemoveDirtMC(16, false) # remove spots
    Stab(range=8, dxmax=4, dymax=4) # stabilize frame bounce a little
    GreyScale() # pure greyscale
    Original on the left (with only the crop), processed on the right:
    Image Attached Files
    Quote Quote  
  14. Member goodiesguy's Avatar
    Join Date
    Sep 2011
    Location
    New Zealand
    Search PM
    Originally Posted by johnmeyer View Post
    That's a really nice, clean kinescope. Since it is 25 fps and since you will be creating a 25 fps result, this is very simple to deal with. You can use any of VideoFred's film restoration scripts (or my variations). They are posted at doom9.org in these two threads:

    The power of Avisynth restoring old 8mm films

    Capturing and restoring old 8mm films


    Here is the result of running your clip through my heavily-modified version of VideoFred's original script:

    Bandstand.avi

    I cropped the edges a little too much because I needed to crop before applying motion stabilization (to get rid of the film gate weave). It is possible to do the restoration without this excessive crop, but I didn't have time to re-write the code.

    I was able to eliminate most of the dirt, and reduce the film grain, so that it looks more like video. I did not take the extra step of converting from 25p to 50i (i.e., back to PAL interlaced), but I could certainly do that. I could also change it to 50p (i.e., 50 full frames a second, non-interlaced). Either 50i or 50p would give it much more of a video "feel," and make it look much more like the original video broadcast.

    The one thing I am not able to do is remove the scratches. Film scratches are very tough to deal with because, unlike dirt where each spot only happens on one frame, the scratches will often persist for dozens or hundreds of frames. If they stayed in exactly the same point, I still might be able to remove them but, unfortunately, they tend to wander back and forth. There are scratch removal filters for both VirtualDub and AVISynth, but in my experience they don't work well enough to make it worth the time to play around with them.

    So, take a look at my result, and if you want to proceed to do something similar, skim through those two long posts. The answers to all your questions about film restoration will be answered there, but be prepared to spend some time reading.

    Yeah, I'm not bothering with the film scratches either, all the things I've tried make it look worse. But that looks great.

    With the interpolation outlined here how would I tweak this to work with 25fps, and is there any settings or particular encoder I need to set with VirtualDub before i output it? I put the finished results into Sony Vegas, tweak the gamma, cropping, Unsharp Mask (to gain back a wee bit of the orthicon tube look) then encode to high bitrate Mpeg-2.

    On another note, how would I go with what was originally a PAL kinescope but on an NTSC DVD? (there are PAL VHS releases of the particular material I'm looking at, but the only digital release was in NTSC in America.)

    And I'm also guessing the damage at the beginning of this Bandstand clip would be far too damaged for AVISynth to handle? (although there's much more detail in this one, although it can't be seen from that clip I linked to on YT, it's only linked the damage at the beginning anyway).
    Last edited by goodiesguy; 27th Mar 2017 at 20:29.
    Quote Quote  
  15. Originally Posted by goodiesguy View Post
    With the interpolation outlined here how would I tweak this to work with 25fps, and is there any settings or particular encoder I need to set with VirtualDub before i output it?
    I can't answer that because the answer depends on what you want the output to be. NTSC interlaced? PAL interlaced? 24p (to be compatible with film)? 50p? 60p? The code is different for each one. Personally, I'd clean it up and leave it as is. In other words, what you see in my sample would be the finished result. The additional fluidity from the field rate conversion is nice, but it sometimes introduces artifacts that are annoying, and there is no way to avoid them without a lot of manual work. So, I recommend you forget about doing this.

    Originally Posted by goodiesguy View Post
    I put the finished results into Sony Vegas, tweak the gamma, cropping, Unsharp Mask (to gain back a wee bit of the orthicon tube look) then encode to high bitrate Mpeg-2.
    I use Vegas Pro too. I recommend using the Color Curves plugin and generate your own custom gamma curve.

    Originally Posted by goodiesguy View Post
    On another note, how would I go with what was originally a PAL kinescope but on an NTSC DVD? (there are PAL VHS releases of the particular material I'm looking at, but the only digital release was in NTSC in America.)
    I would avoid doing standards conversions (PAL <--> NTSC) unless you absolutely must do it. If you live in "PAL land," much of the equipment can play NTSC. Regardless of where you live, most modern digital TV sets can play PAL (or any random frame rate and size), so the only reason to do standards conversions these days is if you insist on playing it from a DVD player that doesn't handle PAL (or NTSC, depending on where you live). This has nothing to do with region encoding, which shouldn't be an issue here. So, my recommendation is to keep it as PAL, play it, and enjoy it.

    Originally Posted by goodiesguy View Post
    And I'm also guessing the damage at the beginning of this Bandstand clip would be far too damaged for AVISynth to handle? (although there's much more detail in this one, although it can't be seen from that clip I linked to on YT, it's only linked the damage at the beginning anyway).
    I don't see anything at the beginning of the clip other than a few big blotches. The dirt removal in my AVISynth script might be able to fix most of them automatically. If not, there are lots of other techniques you can use. For instance, if you don't mind spending a few minutes, you can put the clip on the Vegas timeline, and then duplicate it on a second track. Take that second track (the lower one, which won't be seen) and shift it by one frame. Then, when you see a big blob of dirt that doesn't get removed, make that frame into an individual event (i.e., do a split before and after that frame). Then open pan/crop and draw a mask around the spot, and set the mask so that the area inside the mask allows the track below to show through. Since the track below is one of the adjacent frames, and since the dirt spot isn't on that frame, the mask will make the dust spot disappear. Vegas lets you feather the mask to make the transition almost invisible. Also, if the adjacent frame doesn't quite line up, you can split that event on either side, so it is only a few frame in duration, and then use pan/crop to make the adjacent frame align perfectly. You should be able to get a perfect fix this way.

    I have some really advanced stuff that I created which takes too long to describe, but which I used when I transferred and restored some absolutely horrible Polavision film. This was Polaroid's instant movie film that was sold, briefly, from 1978 to 1981. The film was developed in the cartridge and then projected from the cartridge. As a result, the film has been sitting in the chemical residue for forty years, and huge chemical blotches started to grow. They cannot be removed with film cleaner. I developed semi-automated ways to take totally trashed frames and create good frames by using adjacent frames. I used the same motion estimation technology that is used to change frame rates. The results were still awful (you don't know how bad film can be until you've worked with Polavision), but infinitely better than the original.

    Here is a before/after clip of normal Polavision film. It is pretty bad, but after applying a highly-modified version of my restoration script, it is watchable:

    https://www.youtube.com/watch?v=ud1XNIoh1P8

    And here is the REALLY awful Polavision film that actually had entire sections of emulsion that popped off when the film was unwound from the cassette, creating a white-hot hole in the emulsion where the blotch separated from the backing, followed a few frames later by a huge black blotch which was where that emulsion decided to re-attach itself. It was this project that convinced me to never again do another Polavision project:

    https://www.youtube.com/watch?v=gzTistk2Ms0

    Here is another project where the film in the camera did not register properly, resulting in frames that were not registered properly. Normally you see this in a projector that has lost its loop, but this happened in the camera. I went through and manually market each jump frame, and then devised an AVISynth script that replaced each market frame with a frame synthesized from the adjacent frames. The results were darn near perfect:

    https://www.youtube.com/watch?v=uzMFodrGHDs

    One final thing. These examples appear to be from American Bandstand, the old Dick Clark show. While he let the acts play live in the first few years of the show, eventually all the acts were just lip-syncing. Therefore, when restoring these (I collect old rock performances) I just sync up the pre-recorded version of the song (i.e., the same thing they are lip-syncing to). Vegas makes this easy because you can stretch or shrink the audio so it conforms to any speed changes that might have been made. You can choose to adjust the pitch or keep it the same. Make sure to use the "Elastique" setting when stretching audio.
    Quote Quote  
  16. Originally Posted by goodiesguy View Post
    And I'm also guessing the damage at the beginning of this Bandstand clip would be far too damaged for AVISynth to handle?
    Not at all. You can just crank up the spot removal settings. With just RemoveDirtMC(55, false) you can get the attached video. If you really want you can follow up with some "manual" fixes (like ReplaceFramesMC, or just copying adjacent frames since there little motion in much of the clip) to remove the remaining blemishes. I think that little jiggle near the end of the clip will be hard to fix.
    Image Attached Files
    Quote Quote  
  17. Member goodiesguy's Avatar
    Join Date
    Sep 2011
    Location
    New Zealand
    Search PM
    Originally Posted by johnmeyer View Post
    Originally Posted by goodiesguy View Post
    With the interpolation outlined here how would I tweak this to work with 25fps, and is there any settings or particular encoder I need to set with VirtualDub before i output it?
    I can't answer that because the answer depends on what you want the output to be. NTSC interlaced? PAL interlaced? 24p (to be compatible with film)? 50p? 60p? The code is different for each one. Personally, I'd clean it up and leave it as is. In other words, what you see in my sample would be the finished result. The additional fluidity from the field rate conversion is nice, but it sometimes introduces artifacts that are annoying, and there is no way to avoid them without a lot of manual work. So, I recommend you forget about doing this.
    PAL Interlaced would be the result I want. Yeah, there are artifacts here and there, but I do like the look of it and am keen to at least have a play around.

    Originally Posted by johnmeyer View Post
    Originally Posted by goodiesguy View Post
    On another note, how would I go with what was originally a PAL kinescope but on an NTSC DVD? (there are PAL VHS releases of the particular material I'm looking at, but the only digital release was in NTSC in America.)
    I would avoid doing standards conversions (PAL <--> NTSC) unless you absolutely must do it. If you live in "PAL land," much of the equipment can play NTSC. Regardless of where you live, most modern digital TV sets can play PAL (or any random frame rate and size), so the only reason to do standards conversions these days is if you insist on playing it from a DVD player that doesn't handle PAL (or NTSC, depending on where you live). This has nothing to do with region encoding, which shouldn't be an issue here. So, my recommendation is to keep it as PAL, play it, and enjoy it.
    So I don't need to convert or IVTC when running that into AviSynth?:. All my TV's can play any format fine, PAL, NTSC, SECAM etc.. Just speaking in AVISynth restoration scripts generally here. The NTSC sourced stuff is some 1950's/60's BBC era Benny Hill sketches, which of course were originally PAL Kinescopes, but when released on DVD in America were converted to NTSC (with the only PAL release being VHS in the early 90s)

    Originally Posted by johnmeyer View Post
    One final thing. These examples appear to be from American Bandstand, the old Dick Clark show. While he let the acts play live in the first few years of the show, eventually all the acts were just lip-syncing. Therefore, when restoring these (I collect old rock performances) I just sync up the pre-recorded version of the song (i.e., the same thing they are lip-syncing to). Vegas makes this easy because you can stretch or shrink the audio so it conforms to any speed changes that might have been made. You can choose to adjust the pitch or keep it the same. Make sure to use the "Elastique" setting when stretching audio.
    They're actually from the Australian version based on Dick Clark's show called "Brian Henderson's Bandstand" which is sort of a weird mix of American Bandstand and The Dick Clark Beechnut Show and later did away entirely with the Dick Clark based elements and became more a variety show for Pop music. but yep, I've been doing this too, and it works wonders (at least when a high quality source of the track is available.
    Quote Quote  
  18. With "manual" spot removal:

    Code:
    RemoveDirtMC(55, false)
    ReplaceFramesMC(32,2)
    ReplaceFramesMC(47)
    ReplaceFramesMC(57)
    ReplaceFramesMC(72,2)
    ReplaceFramesMC(78,1)
    ReplaceFramesMC(81,3)
    ReplaceFramesMC(85,2)
    ReplaceFramesMC(88)
    ReplaceFramesMC(90)
    ReplaceFramesMC(106)
    ReplaceFramesMC(131)
    ReplaceFramesMC(154,2)
    ReplaceFramesMC(157)
    ReplaceFramesMC(161,3)
    ReplaceFramesMC(167)
    ReplaceFramesMC(171)
    ReplaceFramesMC(173)
    ReplaceFramesMC(211,1)
    Of course, this will be tedious with long videos.
    Image Attached Files
    Quote Quote  
  19. Member goodiesguy's Avatar
    Join Date
    Sep 2011
    Location
    New Zealand
    Search PM
    I'm still having issues with this script it's outputting a 29.97 result (that's what the frame rate shows when I open it on VDub) and the saved uncompressed .AVI file shows up as not interlaced when I open it in Sony Vegas, and I'm unable to encode with the Interpolation intact correctly to 25fps PAL Mpeg2.
    Quote Quote  
  20. The script was designed to output 29.97 interlaced, so it is performing as I wrote it.

    Uncompressed AVI may not have an interlaced flag. This is true of many formats. You can override that in Vegas. Just right-click on any event and change it, or change it in the media pool. I do it all the time.
    Quote Quote  
  21. Member goodiesguy's Avatar
    Join Date
    Sep 2011
    Location
    New Zealand
    Search PM
    Originally Posted by johnmeyer View Post
    The script was designed to output 29.97 interlaced, so it is performing as I wrote it.

    Uncompressed AVI may not have an interlaced flag. This is true of many formats. You can override that in Vegas. Just right-click on any event and change it, or change it in the media pool. I do it all the time.
    Ah OK, thought I might've been doing something wrong at my end. Just gotta play around now, as I think I've fiddled with my Sony Vegas settings.
    Quote Quote  



Similar Threads