PDA

View Full Version : Telecine of 18fps material


bratloaf
30th January 2004, 19:49
I have been busily capturing a whole slew of super8 and 8mm film. The method I have been using to capture it produces a frame-perfect capture at a true 18fps progressive. The .avi files I have been able to produce have been an order of magnitude cleaner and clearer than anything I have seen short of professional telecine (Rank) transfer.

However, I'm now stuck. I need to convert the 18fps progressive video (Full D1 res, 720x480, 24bit) to 29.97fps interlaced NTSC. There is no sound to worry about (thank god).

I have found one tool that looks to be perfect, and does the "correct" 18fps telecine but it's $69. And I got to thinking last night, I bet avisynth can do this. I KNOW avisynth can do this. But so far my knowledge of avisynth has been limited to using it for resizing, and as a filter processor (like cleaning, despeckling, etc) nothing like frame rate conversion...

Here is the suggested pulldown schemes:

Begin quote from dodcap website:

Option...............Non Interlaced .. Interlaced
16 fps on PAL Video......4:2 ......3:3
15 fps on NTSC Video.....4 ........4
18 fps on PAL Video......4:2:2 ....3:3:2
18 fps on NTSC Video.....4:4:2 ....4:3:3 *
24 fps on PAL Video......2 ........2
24 fps on NTSC Video.....4:2:2:2 ...2:2:3:3

* = what I'm interested in.

NOTE: In the patterns above, each place separated by a colon ":" represents an original captured frame. The numeric values themselves represent how many fields of this frame are output. For example, "3:3:2" above represents three original captured frames--let's call them A, B, and C. The numbers indicate that frame A is
displayed (output) for 3 frames, B is displayed for 3 frames, and C is displayed for 2 frames. The total number of input frames was 3, and the total number of output frames are 4 (i.e., 3 + 3 + 2 = 8 fields = 4 frames). In the output file, each frame of PAL or NTSC video consists of two fields: a top field and a bottom field. We will label these fields "t" and "b", respectively. In the 3:3:2 example just described, the input pattern, showing both top and bottom fields, was "AtAb BtBb CtCb." This represents 2 fields of A, 2 of B, and 2 of C, or three whole progressive frames. The output after the pattern is applied would be "AtAb AtBb BtBb CtCb."

End quote

Now, I understand what is needed, and what this all means. And I just read about pulldown, interleve and select every... and I know the answer is in here somwhere. But I'm at a loss where even to start.

What I'd like is a function to convert 18fps progressive to 29.97fps in either progressive or interlaced. I guess I really dont care about progressive if it makes it more difficult, as I can play the 18fps source on my pc at 18fps.

The intention is to produce DVD compliant MPEG from the above interlaced material. That I can handle once I get the frame rates and interlacing right. I tired this with premiere, and did not like the results (jerky). I have tried the dodcap tool (trial limited to 350 frames) and it works beautifully.

I would really appreciate any help in writing this function...

Thanks in advance!!!

-Jeff

scharfis_brain
30th January 2004, 19:55
hehe, those tasks can EASILY be done with AVISynth without bothering about possible telecine patterns:

18p -> 24p
avisource("video.avi")
assumefps(18)
changefps(23.976)

18p -> 60i
avisource("video.avi")
assumefps(18)
changefps(59.94)
separatefields()
selectevery(4,0,3) #depends on wished
#selectevery(4,1,2) #field-order
weave()

bratloaf
30th January 2004, 20:39
Hmmm.. OK, I feel really stupid here. Not at all a newbie to video, frame rates, etc, but am needing to walk through this. (I want to understand completely what Im doing)

Can you walk me through this? I have read the funcitons, and here is how I'm sorta understanding this:

I'll try that method when I get home. If I wanted to worry about the telecine pattern (I like 4:3:3 because every frame is represented in at least one full frame even in the pulldown).

Would this make sense:


Assumefps(18)
seperatefields()
selectevery(6,0,1,0,1,2,3,2,5,4,5)
weave()
assumefps(29.97)

Here's my (probably flawed) thinking:

assumefps(18) probably unneeded
seperate fields: takes source from ABCDEFG to AaBbCcDdEeFfGg
Select every: takes 6 fields (3 frames) and selects them thus:
AaAaBbBcCc making a 4:3:3 telecine.
weave() weaves fields back together
assumefps(29.97) sets playback speed for new clip (yes?)



Please critique, and if Im on the right track I thank you as I hadn't ever played with any of these kind of functions before.

Thanks, and I can't wait to get home and try ...

nadnamffoh
30th January 2004, 20:45
Pardon the off the subject question. What was your capture setup and how did you clean the film?

bratloaf
30th January 2004, 21:02
I experimented with a number of different techniques. Depending on what you want there are a number of ways to do it, I wanted frame-accurate capture. High resolution, and as accurate color/detail as possible.

Two methods have been acceptable. One is using a modified projector. I basically made a home-made version of this:

http://www.moviestuff.tv/wp_xp.html

I took an old bell&howell projector, fitted a mouse to "ride" the frame advance wheel and added a little pip to click the mouse at the apporpriate time. Using premiere on stop-motion capture (or dodcap, or even a digital still camera on remote capture (canon)).

Only problem so far is: To do this right you really need a good condenser lens/mirror like that shown with the workprinter. I'm 1000% convinced that I could duplicate the workprinter projector for about $200, but I'd still need a good condenser lens and mirror.

My biggest problem thus far with that setup is I need to remove the shutter completely from the projector. Or at least make it "One" bladed so there is less risk of a half-frame capture. This is still the future direction I intend to head. However, I was not able to get the quality I wanted, so I went the (LONG and tedious route) of:

http://8mm2avi.netfirms.com/

I already own an epson RX-500 which scans at 2400x4800 optical, so I did a couple test reels. So far the results are far better than anything else I've tried. It just takes forever, scanning about 50 frames a pass (2 minutes)... Ugh.

As for cleaning.. Well, first two clips I did I didnt clean the film, and regretted it. I hear "goo gone" works really well when used on a chanouis cloth (like a gun-cleaning cloth) so I will be trying that next.

-Jeff

nadnamffoh
30th January 2004, 21:21
Thanks
I am working on the same problems. I have all ready done some with a scanner. It is a very long process. Did you have some automated way to split the scan into frames?

bratloaf
30th January 2004, 21:36
Yes, that software (8mm2avi) automates that process. I then use thumbsplus to renumber the frames sequentially, and open them as an avi in virtualdub. I apply whatever filters are needed, resize, and output to huffyuv avi's. That's as far as I am now. It takes me about "an entire evening" to do one 50' reel. about 65 scans, while at the same time running the scans through 8mm2avi to split them into frames.

If you are gonna do it this way (scanning) the quality can be very high. 8mm2avi splitting the frames makes life much much easier. ($20)

-Jeff

Bogalvator
31st January 2004, 00:55
Obviously the most simple way is:


avisource("yourfile.avi")

changefps(59.94)
separatefields().selectevery(4,0,3) #or (4,1,2) etc...
weave()


Does this not give very good results?

stickboy
31st January 2004, 03:38
bratloaf:

Basically you want to convert every group of 3 frames into 5 frames (18 * 5 / 3 = 30). If your frames in each group are labelled A, B, C, then they originally look like:A B C (top field)
a b c (bottom field)
0 1 2 (frame number)We then can use DoubleWeave to mix the fields from consecutive frames to obtain:A B B C C A'
a a b b c c
0 1 2 3 4 5(assumes that you want the output video to be bottom-field-first)

According to your guide, you want 4 fields from the A frame, 3 fields from the B frame, and 3 fields from the C frame. Therefore, what you want is:A A B C C
a a b b c
We see that these correspond to frames 0, 0, 2, 3, 4 from the DoubleWeave result.

Putting this all together, we get:
AssumeFrameBased()
ComplementParity() # DoubleWeave flips the field order
DoubleWeave()
SelectEvery(6, 0, 0, 2, 3, 4)
AssumeFPS(29.97) # not a problem, since you have no audio

bratloaf
2nd February 2004, 14:58
Ahh, yes, thank you. Now this is all making some sense. I am not opposed to the other method of doing it, I just like knowing exactly what is being done. The reason I like going 4,3,3 is that I know, for sure, that I have at least one full still frame of each and every full frame in the source. For instance, suppose worst case I wanted to someday IVTC a clip, with this pattern it's easy and I know for sure I can get back to (a reasonable facsimile) of the original without worrying about field blends etc.

Thanks everyone for all the help. I was away for the weekend so I didn't get to try these out yet. Cant wait to tonight. Maybe I can finally burn a dvd of these and test them on my tv/dvd.

-jeff

pirej
14th May 2010, 21:49
Hi, i need some help with SelectEvery(....) , i have a 18p avi, and i want to make it 25i TFF.
I gues the pulldown scheme should be 3:3:2 , but how to apply it in Selectevery(?,?,?,?)
I tryed some combinations but with no good results.

Thanks.

neuron2
14th May 2010, 22:08
The most you can get out of 18 fps with field pulldown is 24 fps.

manono
14th May 2010, 23:01
i have a 18p avi, and i want to make it 25i TFF.
Encode it as it is and then apply DGPulldown set for 18->25fps (assuming it's for PAL DVD). Keep it progressive.
The most you can get out of 18 fps with field pulldown is 24 fps.
Am I misunderstanding you (or the OP), neuron2? This is for PAL so you can apply pulldown on framerates as low as 16.67fps (2/3 the final framerate, not 3/4). Or are he and you talking about 'hard telecining' it while I'm recommending a 'soft telecine'.

Gavino
14th May 2010, 23:07
As neuron2 says, applying 3:3:2 pulldown to 18fps will give 24fps (every 3 original frames produce 8 (=3+3+2) output fields, 4 output frames). This can be achieved in Avisynth (for a 'hard' telecine) by:

AssumeTFF()
SeparateFields()
SelectEvery(6, 0,1, 0,2, 2,3, 4,5)
Weave()

This is exactly the same as:

ChangeFPS(48)
AssumeTFF()
SeparateFields()
SelectEvery(4, 0,3)
Weave()

You can then follow this with AssumeFPS(25) to speed up to PAL rate.
Alternatively, you can just use:

ChangeFPS(50)
AssumeTFF()
SeparateFields()
SelectEvery(4, 0,3)
Weave()

which will give 25fps directly, effectively with a pulldown pattern of 3:3:3:3:2:3:3:3:2:3:3:3:3:2:3:3:3:2.

pirej
14th May 2010, 23:46
Thank you all, i'll try this options.
Another question: My video source is 8mm(1971)=> Ntsc vhs => Pal vhs, an i cant get the 8mm or the Ntsc version.
I did telecide and multidecimate, and i got 18,561 fps with no duplicates, i've tryed fdecimate instead of multidecimate and the fps its~the same.
Even with the Fdecimate's guide for determing the final framerate i stll get 18,5+ fps
So, what to do with the 18.561 framerate?? Do i just AssumeFps(18) and edit/encode, or should i use the 18.561 fps( i allready had some errors with avsp when opening the 18.561 fps script)

neuron2
14th May 2010, 23:58
Encode it as it is and then apply DGPulldown set for 18->25fps (assuming it's for PAL DVD). Keep it progressive.

Am I misunderstanding you (or the OP), neuron2? This is for PAL so you can apply pulldown on framerates as low as 16.67fps (2/3 the final framerate, not 3/4). Or are he and you talking about 'hard telecining' it while I'm recommending a 'soft telecine'. You're quite right. I emitted a brain fart. The max will be 3/2 * 18 -> 27. So DGPulldown with custom 18 -> 25 will be fine. Or one can use the hard telecine equivalent as Gavino said.

Thanks for correcting my error. You'd think as the author of DGPulldown I could get it right. :p

Gser
15th May 2010, 00:14
How about mflowfps instead of changefps

pirej
15th May 2010, 00:38
How about mflowfps instead of changefps

I've tryed it, i get too much artifacts, my source isnt the best one :(

manono
15th May 2010, 04:52
I did telecide and multidecimate, and i got 18,561 fps with no duplicates
How about dropped/missing frames? Are you sure it's not 18.75fps?

Again, my recommendation is to encode it as-is and apply DGPulldown afterwards to bring the output up to 25fps. Encoding as progressive 18.xxxfps is way more encoder efficient than is encoding for interlaced 25fps, and will give you a much better quality (~50% better, give or take) for the same file size.

Of course, the encoder will only encode for a relatively few framerates, but DGPulldown will put it right at the end (with no need to stretch the audio). You will have to adjust the bitrates used, though.

pirej
15th May 2010, 09:20
I've did it 1test with avisynth(25i) like Gavino said, and 2test with assumefps(25.0)avs=> 25p.mpeg2 => dgpulldown to 25i, and i can't see real difference between the two videos...except the final video size.
1test using avisynth = 57.4 MB bitrate (4500/8000)and it come out with Overall bit rate: 4 500 Kbps
2test using DGPulldown = 43.1 MB same bitrate (4500/8000)and it come out with Overall bit rate : 3 382 Kbps
So.. i should use higher bitrate with the 2test to make it the same Bits/(Pixel*Frame) like the 1test??

manono
15th May 2010, 09:54
...and i can't see real difference between the two videos...
You can't tell the difference between a progressive encode and an interlaced encode?
So.. i should use higher bitrate with the 2test to make it the same Bits/(Pixel*Frame) like the 1test??
Like I said, you'll have to adjust the bitrates to get the size you want. If the video is 18fps and you encode at 25fps, you increase the bitrates by a factor of 25/18=1.39. Multiply your 4500/8000 each by 1.39 to get the equivalent bitrates and file size to your 'real' 25fps encode.

pirej
15th May 2010, 12:13
No Manono, u have missed something, 1test its not progresive, its 25 fps interlaced
I've did it 1test with avisynth(25i) like Gavino said
using script that Gavino sugested
ChangeFPS(50)
AssumeTFF()
SeparateFields()
SelectEvery(4, 0,3)
Weave()

So the both test videos were interlaced.
Thanks for the info for the bitrate.
Now i can finally edit my 18fps avi, and make DVD out of it.
Thanks again.. to everyone of you guys, you are great.

manono
15th May 2010, 13:05
I've did it 1test with avisynth(25i) like Gavino said, and 2test with assumefps(25.0)avs=> 25p.mpeg2
So you didn't make one interlaced encode and one progressive encode? If not, what does what I just quoted really mean?

pirej
15th May 2010, 14:35
and 2test with assumefps(25.0)avs=> 25p.mpeg2 => dgpulldown to 25i

Well.. :) i was thinking that the 2test(with DGPulldown) its interlaced, and when i compared the two versions with virtualdub.. they really seemed alike.
I know the difference between progressive and interlaced, and the difference is obvious, but in this case.. ??? I checked bout clips with mediainfo and for the dgpulldown version it says progressive (stupid me), and with gspot tool it says "interlaced" for the same clip but there is something strange with the gspot info..(see the screenshots)
Excuse me for my lack of knowledge regarding DGPulldown, i was thinking that the autput was going to be interlaced.

p.s. English is not my native language, so maybe i didnt understood something about the process.

neuron2
15th May 2010, 15:43
With DGPulldown, the video is encoded as progressive but contains flags to tell the player to pull down fields. So the encoded content is progressive at 18fps (in this case) but it is displayed as interlaced at 25 fps.

Emulgator
15th May 2010, 18:26
BTW, pirej, I see your video is 768x576,
but if you aim to make a PAL-DVD
you will have to resize before encoding to 720x576 (MPEG-2 SAR = 5:4)
with PAR = 16/15 = 1.0666 for 4:3 footage,
or PAR = 64/45 = 1.4222 for 16:9.

pirej
15th May 2010, 23:46
Thank you neuron2, i've never used DGPulldown before, and i didn't "read the manual" :) , my mistake.
Emulgator, thanks for the info, i wasn't going to leave it 768x576, it's just captured that way.. ill crop/resize it :)

manono
16th May 2010, 00:17
Using CCE, I think? GSpot always says CCE output is interlaced. It's some kind of a bug. Even the progressive MPV before pulldown will show as interlaced. What's important in that second pic is the pics/s and frames/s. One is the encoded video framerate, the other the output framerate.

In this case MediaInfo (or ReStream, or Bitrate Viewer, or DGIndex, or many other apps) is more reliable in showing you it was encoded as progressive (exactly the right thing to do). VDub can be set to show the progressively encoded video (ignoring the flags) or the interlaced output. If you're seeing interlacing in the 2test after the pulldown, you're seeing the output. VDubMod, on the other hand always ignores the pulldown flags and will only show you the encoded progressive frames. If you set DGPulldown as 20->25fps (why, when you said earlier it was 18.xxxfps?), then only progressive 20fps video is actually encoded, unlike your 1test.

Also, if you have both videos about the same size (not yet, judging from the 2 pictures), you might run them both through Bitrate Viewer and compare the Q-Levels. You might be surprised. Also notice how the pulldown you applied changed the length of the second one, badly messing up the audio synch.

pirej
16th May 2010, 11:08
Thanks Manono, i soo that problem yesterday, i'm doing another testing, and i set it 18 to 25 in dgpulldown (as before) and i still get the same info with g-spot "20pics/s ,25 fps/s, 50fields/s" , i'm not shore where is the problem... but ill try again.
I've did 3 versions of source files for dgpulldown, (18 to 25, 18.561 to 25 and 18.75 to 25), and i set dgpulldown acording to the input file (18 to 25, 18.561 to 25 and 18.75 to 25), and AGAIN i get the same GSPOT info for all of them "20pics/s ,25 fps/s, 50fields/s".
Is there something else to set/tweak in DGPulldown besides framerate??

manono
16th May 2010, 11:19
I just ran a test encoding for 25fps and then applying DGPulldown for 18->25fps and got the same as you in GSpot (20 pics/s and 25 frames/s). Another bug in that program. Ignore it. If you apply pulldown for the same framerate as the original script, the audio should remain in synch as the length doesn't change.

pirej
16th May 2010, 11:52
Ok, now i see that GSPOT doesent calculate the correct total length of the dgpulldown-ed video, the 25i test using avisynth and the 25p using dgpulldown are the same length according to mediainfo, and virtualdub, and not with GSPOT. So... GSPOT seems to bee a ''great'' infotool :(
Thanks for the help manono