Log in

View Full Version : The John Meyer Method of Telecine


ianbren
26th September 2013, 04:37
[Tip of the hat to you JohnMeyer]

Like many of you, I’m getting enjoyment both in keeping our movies alive and in the experence of developing a telecine model. I wanted to pay back for the help I’ve had in exploring my telecine project.

I came across John Meyer’s method about six months ago and I’ve been hooked on the simplicity of the model. I wanted to share my experiences.

Back in 2002 John shared a brainwave and invented a model for Telecine. You can read it here http://forum.doom9.org/showthread.php?t=106837

In essence, his insight was that if the shutters were removed from the projector a camcorder running at a reasonably high speed would be able to record both the frame moving into position as well as the steady state of the frame when it settles in tho the gate.

Using AviSynth, he would then process the complete video and extract out the frames from the clutter. You would end up with a video with no interlace and no duplicates.

The beauty of this method is that you don’t need to track the projector’s mechanical progress, don’t need modified mice or any microswitches, magnets etc. You set up your video camera and away you went. As long as the camcorder ran at more than twice the fps of the projector this would work.

I contacted John recently and he generously shared his model. John’s method used TFM to identify the blur found when the film is in motion. His method processed the resulting log file in Excel.

Even though he shared his tools and insights with me, I could never get the quality that he did using his method. I have no idea why.

After a number of false starts, I’ve built on his idea but used “DeDup” to show where duplicate frames are. But the model is essentially his.

Here’s some of my footage on YouTube using John’s capture method http://youtu.be/2neBYuF3lgA - you will get the idea after a few moments, so pause when you’re ready, we’ll come back to the video later. You can see there are periods of blur as the film progresses across the gate. [Ignore the quality of the capture – this was a quick and dirty experiment].

Let me jump to the detail to show graphically what DeDup logs for that footage. Here’s the graph http://flic.kr/p/g9JUE3

DeDup identifies the percentage change between sequential camcorder frames.

The large spikes are where the movie frames transition into the gate – the transition from a stable image to a blur and then stability when the next frame comes to rest as shown in the movie above.

In the above capture, the camcorder was running at 50 fps and the projector was running about 1/4 of that speed. That is, there are four spike areas every 50 frames.

My solution processes DeDup logs looking for peaks, then wait for the next sequence of low values and pick one of them as the frame to include in the final movie.

The log file is processed with a short VBSCRIPT. My code sets a threshold over which it assumes all values are frame transitions – in the graph above, anything over 5% would be assumed to be frame movement. Anything below that value is assumed to be a stable frame.

The transition between frames can, in the graph above, can cover two or video frame, depending on the moment where the video captures the transition. This is addressed by looking for a number of consecutive “lows” values, which means all film motion have stopped. I leave it to the reader to speculate what the trough represents.

The code then skips subsequent "low" values until it detects another set of low-> high transitions and then starts the process again.

If you continue with the youtube video you can see the resulting movie. http://youtu.be/2neBYuF3lgA

There are some limitations to this method. If the film/capture is seriously over or under exposed then the transition may not show clear peaks. Raising or lowering the threshold can address this, but runs the risk of clipping real frame sequences, or including frame transitions into the final sequence.

I’ve tried this across a number of captures and a number of cameras – including webcams, microscopes and DSLRs. As long as there is good exposure you get the capture.

If you’re interested I’ll share the AviScripts and VBScripts.


Thanks again John for your inspiration.

hanfrunz
26th September 2013, 10:53
Hello ianbren,

just an idea: you could record the sound of the projector when it runs. If you are lucky you can analyse the audio to detect the phases of non moving film. Should be a lot easier then analysing the video.

regards,
hanfrunz

johnmeyer
26th September 2013, 17:34
just an idea: you could record the sound of the projector when it runs. If you are lucky you can analyse the audio to detect the phases of non moving film. Should be a lot easier then analysing the video.That's an interesting idea. Roger Evans, the inventor of the Workprinter/Sniper transfer machines does something somewhat similar in one of his models: using a cam on the shutter gear, he creates a beep every time the projector shutter starts to close and records that audio along with the video. He then uses that audio signal to know exactly which fields to keep and which ones to discard.

I came across John Meyer’s method about six months ago and I’ve been hooked on the simplicity of the model. I wanted to share my experiences.First of all, thanks for the post. Here are a few comments on your advancements to my initial invention. I didn't realize it has been over a decade since I developed the idea. I've transferred a lot of film since then and can't believe it has been that long.

The major comment is that in the approach I use, the projector is still running at full 24 fps speed. To make everything work at this speed, the camera has to be capable of snapping the entire field at once (you need to use a CCD camera), and the camera should be set to a shutter speed of 1/1000 of a second or faster. You then have to figure out which field to throw out (the field that is blurred from the pulldown), and then combine the next two fields into one frame. Upper and lower field dominance are completely irrelevant; all you need to do is make sure you get a matching pair of upper and lower fields, and then combine them together in a frame. Field dominance doesn't matter because the source (the film) is progressive, so there is never any temporal difference between fields, only spatial. This is always a difficult concept to get across.

In my full speed setup, you cannot lock onto an exact pattern because neither the camera (29.97 fps) or the projector (24 fps) run at exactly their rated speeds, and this drift in timing means that sooner or later a blurred pulldown field will come along one field later than expected. As a corollary to this problem, some pulldown fields are not as blurred as others because the camera snaps the picture only a millisecond before the film comes to rest, so it is almost in focus. However, this field still must be discarded. So to do the field decimation correctly, you have to go backwards and find a field that is completely and totally blurred (which is easy to figure out) and use that as a local reference. The next two fields after a totally blurred field are always good and always should be combined together into a frame. The next field after that is more likely to be blurred, but may not be, and so on.

So, at full speed, working backwards and forwards from the totally blurred field references is the technical challenge.

Once you slow down the projector, especially if you slow it down a lot as shown in your YouTube clip above, the technical challenge changes. With a slow projector you can rely entirely on finding one or more matching frames (you no longer have to rely on fields), and then decimate all but the frame in the middle of your "spikes." I see no issues with what you've done with this improvement, and I think it avoids the issues I described above with my 24 fps approach.

The only downside is that with the projector running this slowly, the transfer is going to take a long time. That is the obvious tradeoff.

There are some limitations to this method. If the film/capture is seriously over or under exposed then the transition may not show clear peaks.This is a problem with lots of other AVISynth scripts which rely on analyzing the video content. My solution to this problem, which should also work for you, is to use a

colorYUV(autogain=true)

statement before you do any detection. You then use this extremely contrasty clip for the detection, but do the actual frame recovery operation on the original clip. This should also help get more reliable detection even with correctly exposed film.

My last comments have to do with the results I saw in that YouTube clip, and have nothing to do with your software. I saw a big reflection in the center of the clip. Perhaps you were just videotaping your monitor in order to show the process. Hopefully that reflection is not part of the final result. If it is, you need to use a completely dark room when doing the transfer.

Also, make sure that you always expose for the highlights. Use the zebra function on your camera to show you when the highlights are being over-exposed and reduce the exposure on your camera until those zebras disappear. Then, in post production, use software that can gain the shadows and midtones while leaving the brighter portions of the image exactly as they are. Film has a much wider gamut than video and this operation is always needed, at least to some degree, on every film transfer, unless you can adjust the gamma function in your camera, which is a feature not found on most cameras costing less than $4,000.

The "spotlight" function on Sony cameras is designed to not let highlights blow out and should always be turned on when doing film transfers. Other makes and models may also have a similar feature.

Finally, make sure to set the playback speed correctly. Most 8mm film should be played back at 16 fps and all Super 8 film plays at 18 fps. 16mm can be just about anything, depending on what era it was taken.

ianbren
27th September 2013, 00:20
Thanks for the feedback and the tip about getting the contrast up for the detection. I’ll experiment with that over the next week.
As you say, the key innovation on your method is that with the camera running at a speed faster than the projector, you can capture the film motion as well as the steady-state and thus use one to find the other.
The cameras I’ve been using (Webcams, USB Microscopes and [in this case] a DSLR) all have “normal” speeds of between 30fps and 60fps. That meant I had to run the film projector slower to maintain the relative frame speed the same.
The spots in the middle of the video is a 3-LED 12v lamp in place of the standard halogen. This was a quick-and-dirty test to show your method. Now that I know it works I’ve ordered a different light source to even out the lighting.

I’ve posted the source code at http://sdrv.ms/186zWXO

Cheers

Ian

johnmeyer
27th September 2013, 01:17
The spots in the middle of the video is a 3-LED 12v lamp in place of the standard halogen. This was a quick-and-dirty test to show your method. Now that I know it works I’ve ordered a different light source to even out the lighting.I used a low-wattage halogen bulb instead of the 400 watt bulb that the projector normally uses. However even this dimmer bulb produced a hot spot.

The optical path between the bulb and projector lens is different for every projector, and the severity of the inevitable hot spot is going to be different, but my guess is that you will find that you still have a hot spot, even when you get your new bulb. What I did for my setup was to go to the hardware store and buy some frosted glass, about 40mm square. I wanted heat-tempered glass, but they didn't have any. However, since my bulb is fairly low-wattage, and since there is a fan blowing whenever the light is on, the frosted glass doesn't crack. I had to jury rig a mount to hold it in place, between the light and the condenser. It made a very big difference in the evenness of the illumination.

Thanks for the feedback and the tip about getting the contrast up for the detection. I’ll experiment with that over the next week.As I mentioned in my last post, I recover the original film frames using a two-pass approach. In the first pass, I simply send the TFM metrics to a text file. I then parse these in an Excel spreadsheet file and use macros in that spreadsheet to create metrics that I send to TDecimate during the second pass. I have copied the pass 1 script below. As you can see, it is extremely simple. Since I never actually view or save the clip, I can do anything I want to it in order to improve the field detection and matching performed by TFM.

loadPlugin("c:\Program Files\AviSynth 2.5\plugins\TIVTC.dll")
AVISource("E:\film.avi").killaudio()

#Remember to set this for HDV vs. DV!!!!
AssumeBFF()
converttoYUY2(interlaced=false)
colorYUV(autogain=true)
tfm(display=false,micout=2,mode=0,cthresh=45,mi=120,pp=1,metric=0,field=1,mmsco=false,micmatching=2,slow=2,output="e:\tfm.txt")