Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
4th February 2006, 21:53 | #1 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
High Speed Film to Video Transfer Machine -- Need IVTC Help
I'm transferring 16mm film to video. I have an 8mm Workprinter, which captures one frame at a time, but at very slow speed.
I had a brainstorm: Remove the shutter from a 16mm projector, set the "shutter speed" on my video camera to 1/1000 second, capture the video, and then process with IVTC software. A sketch of the relative timing of the film and the video camera shows that no matter what the relative timing of the projector and the camera (they cannot be synchronized), I can be absolutely assured of the camera taking two complete fields (one frame) for every frame of film. Depending on where the film is in its pulldown cycle, the next field after the two good ones will either be: 1) A third duplicate; 2) The film during its pulldown cycle, which will not match either the film frame before or the film frame after; 3) The next frame of film. I have tried the normal Telecide() Decimate() routines because I thought that the captured video would be virtually identical to video that contained 3:2 pulldown film. However, I have not been able to get this to work. I can use SeparateFields to look at each individual field, and indeed what I expected in theory is indeed what I have captured in practice. I really do think that this invention will let me capture film a frame at a time, but at full 24 fps speed. However, I need some ideas, guidance, or help on what I should try next. I have thought of building a script using motion estimation software, like MVTools, to do my own field matching and decimation and ultimately that's what I may have to do. However, it sure seems like this software -- perhaps with FDecimate instead of Decimate -- should be able to do the trick. With the Show=True in the Telecide filter, I get four good recovered frames. Then, either the fifth or sixth frame (not consistent because the projector is slightly slower than 24 fps), I get an interlaced frame (as reported by Telecide) which needs to be discarded. However, about every fifth group of five frames, I instead get a duplicate frame (because the unique frame captured during pulldown is skipped). This frame should also be discarded. One last piece of info: Even with a synchronous AC motor in my Eiki projector, the film is not exactly 24 fps, so the pattern doesn't exactly repeat. Therefore the software has to adapt, which of course is the heart and soul of this smart IVTC software. Last edited by johnmeyer; 4th February 2006 at 21:56. |
5th February 2006, 03:10 | #3 | Link | |
Registered User
Join Date: Feb 2004
Posts: 743
|
Quote:
Richard www.photorecall.net |
|
5th February 2006, 03:40 | #4 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
they are either spring motor or battery operated and are not constant speed, so you will have always some blended fields, no way around this. A frame at a time is the only way to go.
If I was doing a capture with a 3- or 5-bladed shutter, you would be correct. However, I am doing something completely different here. I have removed the projector shutter and am capturing using a very high shutter speed on the video camera (1/1000 of a second). Therefore, there are no blended frames. There can't be. The resulting video is very similar to telecined video -- although not exactly the same, hence this post. Thus, whether the original video was shot at 15, 18, or 24 fps, or whether the camera or projector are constant speed don't really matter, except that the IVTC algorithm can't rely on the "pulldown pattern" being exactly constant (it never can even with telecined film, but this is even tougher). I am quite certain that the film can be IVTC'd. I'm working on uploading a sample. I should have it shortly. |
5th February 2006, 03:43 | #5 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
OK. Here's a link to a 14.9 MB 3-sec NTSC DV AVI clip. This is exactly as it was captured, with no modifications at all. The link will take you to my Yahoo briefcase page. You will then need to click on the "film to video test" link to download the clip (I can't post a direct link to it).
http://briefcase.yahoo.com/bc/john_m.../Video&.view=l |
5th February 2006, 05:10 | #6 | Link | |
Registered User
Join Date: Feb 2004
Posts: 743
|
Quote:
My question is how do you know that the frame is stopped and centered when you take the 1/1000 sec exposure? Without some type of sync circuit, how are you eliminating capture frames when the film is advancing? Thanks for posting the clip. Richard |
|
5th February 2006, 05:15 | #7 | Link | |
Registered User
Join Date: Feb 2004
Posts: 743
|
Quote:
See http://briefcase.yahoo.com/bc/john_meyer77@sbcglobal.net/lst?.dir=/Video& Richard |
|
5th February 2006, 05:25 | #8 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
My question is how do you know that the frame is stopped and centered when you take the 1/1000 sec exposure? Without some type of sync circuit, how are you eliminating capture frames when the film is advancing?
I'll admit that what I'm doing is pretty unconventional and therefore may not be immediately obvious. If you draw a timeline and put tick marks every 1/24 second, that represents the timing for the film. Now about 12% of the way into each 1/24 second frame, put a little tick mark. The point between the start of each frame and that tick mark is the pulldown, when the film is moving. The rest of the time, the film is stationary. Now, above that timeline, place a dot every 1/60 of a second. Each dot represents the capture of one field of video. You need two fields of video to get a complete frame. If you stare at these two timelines, you'll eventually realize that no matter when the camera happens to take its two fields relative to when the film comes to rest (because, as you point out, the projector and the video camera are in no way synchronized), the camera will ALWAYS be able to capture two good fields of every frame of film. Now, the trick -- and the whole purpose of this post -- is to figure out what to do with the "extra" fields that are captured. Sometimes you will get a field that is captured while the film is moving. Sometimes you will get a third field that duplicates the previous two. Those need to be discarded. I thought up this whole scheme a month ago and have been working on it for some time. Everything is working exactly according to theory, and all I have to do is figure out how to either modify Decimate() or FDecimate() so they will do what I want, or else write my own decimation code (which I can do, but would like to avoid, since lots of sharp people have written some pretty smart decimation code that can handle exactly this sort of problem). |
5th February 2006, 05:35 | #9 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
The link isn't correct
If you get a Cannot Find Server message, press the retry button on your browser to retry the link. Yahoo Briefcase is finicky. I just clicked on the link above (the one in your email) and did indeed get a Cannot Find Server error. I just clicked on retry and was connected. If you have any suggestions of a more reliable, free place to upload my clip, I'll gladly upload there. |
5th February 2006, 22:19 | #10 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
That link I provide does work -- but apparently only sometimes. Here is a link to my own website. This will download just by clicking on the link:
http://www.themeyersite.com/Sounds/f...video_test.avi Not the fastest server in the world, but it shouldn't take too long. Thanks for being patient. Also, thanks in advance for any help that any of you can provide! |
6th February 2006, 04:16 | #11 | Link | |
Registered User
Join Date: Feb 2004
Posts: 743
|
Quote:
One way you may want to detect the moving frame is the the vertical resolution will drop off the chart, this should be the key. Thanks for making me think. Richard |
|
6th February 2006, 04:25 | #12 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
So far, detecting the frames with Telecide() works perfectly. The frames that it reports as interlaced ALL should be discarded, and the frames that it reports as duplicates should be discarded. The only thing missing is figuring out how to use an existing decimation routine -- like Decimate() or FDecimate() -- or one that I write, to take that information and delete the frames. I think that Telecide() can be made to pass information to other routines, but I'm not quite sure what the interface might be.
I'm so close to having this work. Hopefully with a couple of hints I can finish this off. I've have about 50 hours of films waiting to be transferred (and that's just the start). Thanks for you input and help. |
6th February 2006, 04:37 | #13 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
this is quite ingenious. rfmmars has a good point about vertical resolution. a modified comb mask (that takes a wider area into account) could be used to detect these frames. scenechange detection could also be useful, but would drop fields on actual scenechanges.
also, i haven't spotted a ratio of blurred fields to good fields as yet. i'm sure one exists, but it might vary by quite a bit. so it might make more sense to output a copy of the last good field and then decimate in a separate step (this would also make scripting a solution much easier - avisynth's conditional environment isn't able to arbitrarily remove frames. input framecount and output framecount must be equal). i can imagine a reasonably simple method of detecting and replacing "blurs", and then decimating using a regular decimator plugin like decimate or tdecimate or whatever. this would also mean A/V sync isn't an issue.
__________________
sucking the life out of your videos since 2004 |
6th February 2006, 07:03 | #14 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
The moving frame isn't really the way to do any detection, because it is possible to happen to take the 1/1000 second capture just at the beginning or end of the pulldown, in which case the error will be rather slight. Instead, the way to do this is to have a routine that "syncs up" to the pattern using field matching. This is easy because there are two ways to sync up. First, when one field is completely different from the next, you know you have crossed into a new frame or film, or into the film pulldown area. If the next field after that "matches," then you are within a frame of film and those two fields should be chosen. If the field after that one matches also (which happens once in awhile, then you take the better match between fields one and two, or fields two and three, and use those two fields to make a frame.
The second way to sync up is to look for situations where one field is totally different from both the field before and the field after. This clearly is a pulldown field, and should be discarded. The next two fields will always be good. The Telecide() function that is part of Decomb is detecting everything perfectly and is giving me all the information I need to make this work. The problem is that I can't get any decimate function to use this information to take the proper action and throw away the frame. If you use this code: Code:
converttoYV12(interlaced=true) AssumeBFF() Telecide(show=true,guide=0,post=1) Last edited by johnmeyer; 6th February 2006 at 07:12. |
6th February 2006, 07:26 | #15 | Link |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
|
TFM should be able to match Telecide's prog/interlaced decisions, and it has a "clip2" parameter so that you can supply your own output for interlaced frames. Maybe a blankclip(last) or blankclip(last,color=$0000FF) or even colorbars, something you can easily detect and delete. Then you can decimate away spurious duplicates, which hopefully might even show some pattern.
I don't know if a filter exists such as Code:
tfm(clip2=colorbars) removefrom(last,colorbars) |
8th February 2006, 01:55 | #16 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
Thanks for the TFM tip. I am getting close using this script:
Code:
loadPlugin("c:\Program Files\AviSynth 2.5\plugins\TIVTC.dll") AVISource("E:\Film\Film Test.avi") converttoYV12(interlaced=false) AssumeBFF() tfm(display=false,mode=5,pp=1,cthresh=16,mi=125,debug=false) tdecimate(debug=false,display=false,cycleR=7,cycle=38) So, in a nutshell, what would be ideal is to use the combining values of 255 as a way to reset the cadence (so the thing can sync up at the beginning of the film). From that point on, the next four frames can absolutely, positively be guaranteed to be progressive. Then, one of the two next frames is either going to be massively combed or, if the timing between camera and projector is just right, it will be a third duplicate (TFM matches the third duplicate field with the previous field). In either case, that's the one to decimate. Thus, what I want to do is somehow figure out how to communicate with TFM from within a script and write my own decimation code that smartly deletes the fifth or sixth frame, but never touches the next four. |
8th February 2006, 02:09 | #17 | Link | |
Guest
Join Date: Jan 2002
Posts: 21,901
|
Quote:
|
|
8th February 2006, 05:30 | #19 | Link |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
|
If you're willing to install .Net 2, VS2005 express is free. You should be able to load and compile decomb immediately, and make changes from there.
|
Thread Tools | Search this Thread |
Display Modes | |
|
|