Page 1 of 1

Detelecine?

Posted: Wed Aug 22, 2007 12:02 am
by MuckSavage
Did a google search, but still unsure of what this does? Anybody have any links or a quick explanation?

Posted: Wed Aug 22, 2007 12:11 am
by hawkman
I have a suggestion: read the damned HandBrake Guide :) http://handbrake.m0k.org/trac/wiki/HandBrakeGuide

It's not an entirely straightforward concept to explain, so I'm not even going to attempt a summary.

Posted: Wed Aug 22, 2007 12:15 am
by MuckSavage
Thanks for the link.

Posted: Wed Aug 22, 2007 12:43 am
by hawkman
Wow, seeing my response there it sounds really harsh. It was only meant to be a gentle jibe!

Do we have to pay extra for "attitude"?

Posted: Wed Aug 22, 2007 6:17 am
by MichaelLAX
hawkman wrote:read the damned HandBrake Guide :)

Wow, seeing my response there it sounds really harsh. It was only meant to be a gentle jibe!
Can't wait to see your response when you're really angry!

Posted: Wed Aug 22, 2007 4:31 pm
by egor
I've read a lot about this because over half the movies on my shelf have been telecined using 3:2 pulldown. I was thrilled when I saw the detelecine feature added to Handbrake, but I'm missing some key piece of info:

Specifically, when I run a telecined movie through the detelecine process, the interlacing disappears (as expected), but the movie remains at 29.97 fps (giving a duplicate frame every fifth frame). I would have expected the process to drop the duplicate frame and render a 24 fps movie.

Feel free to chastise me for "not reading the manual." I've read a zillion of 'em but, obviously, not the right one. :)

Posted: Wed Aug 22, 2007 4:43 pm
by cvk_b
egor wrote:
Specifically, when I run a telecined movie through the detelecine process, the interlacing disappears (as expected), but the movie remains at 29.97 fps (giving a duplicate frame every fifth frame). I would have expected the process to drop the duplicate frame and render a 24 fps movie.
You're right. It's not discarding doubled frames... yet.

Posted: Wed Aug 22, 2007 5:03 pm
by huevos_rancheros
cvk_b wrote:You're right. It's not discarding doubled frames... yet.
Exactly - the primary concern with discarding frames in the detelecine filter was keeping sync with the audio. By duplicating frames, the sync issue was sidestepped for the time being until a proper mechanism for dropping the frame rate from 30 fps to 24 fps while maintaining audio/video sync could be worked out. This is mentioned briefly in the HandBrake frame rate guide.

For material that is sanely telecined, I still find the current detelecine approach preferable to deinterlacing even with the new deinterlace options, since you don't get any deinterlacing artifacts (i.e. ghost images, broken or jagged lines in animation, etc.) in the resulting video.

Posted: Fri Aug 24, 2007 6:27 am
by Anamonde
Why is audio sync even a problem? Surley you dont have to do anything to the Audio at all.

After all, a 2h12 movie at 29.97 is still a 2h12 movie even at 24fps. The audio can just stay the same.... unless each frame is linked a specific time in the audio track for some reason.

I am not sure how handbrake is built as I am not a programmer, but I do work in digital post-production and frame rates is something I have to work with every day... sorry I can't be more help.

Posted: Fri Aug 24, 2007 8:29 am
by PuzZLeR
Not sure what happens in the MP4 container, but if you interleave every frame with a segment of audio, then changing the framerate could mess with the sync. This could definitely happen in something like an AVI container, or even with MPEG-2. Time stamps, etc. could be thrown off. Being an old-school "DivX-er", this was a typical problem we had to deal with.

Nevertheless, I wouldn't worry about it. Here's your answer at any rate.

Many experienced encoders encode their video and audio separately and mux them together afterwards. Assuming both audio and video have the same lengths at the end of encoding, it should be no problem. The sync should be fine at any video framerate.

Posted: Sat Aug 25, 2007 6:27 am
by huevos_rancheros
Hmm...now that I think about it, you are both correct that A/V sync shouldn't really be an issue. When I originally put the code in, I was dropping frames but that caused some difficulty with sync, so I just modified the ported mencoder pullup filter to duplicate older frames instead to maintain 30 fps.

However, jbrjake mentioned that we were previously not correctly receiving a particular piece of the puzzle (the PIC_FLAG_REPEAT_FIRST_FIELD frame flag from libmpeg2) and this has apparently been fixed and should be showing up now. I'll take another look at the code to see if the original method of dropping frames is functional now that we are receiving this information.

Posted: Sat Aug 25, 2007 6:47 am
by eddyg
huevos_rancheros wrote:Hmm...now that I think about it, you are both correct that A/V sync shouldn't really be an issue. When I originally put the code in, I was dropping frames but that caused some difficulty with sync, so I just modified the ported mencoder pullup filter to duplicate older frames instead to maintain 30 fps.
Isn't sync before render? In which case you are dropping the frames after they have been synced. If it were before then there definitely wouldn't be an issue. Being afterwards there may be an issue, but I'd have to look at that more closely. They are still using the PTS timestamp so in theory it shouldn't be an issue. However we traditionally are interleaving audio and video out of the sync thread, which would result in issues.

Basically suck it and see for now.

Cheers, Ed.

Posted: Sat Aug 25, 2007 7:40 am
by huevos_rancheros
eddyg wrote:Isn't sync before render? In which case you are dropping the frames after they have been synced. If it were before then there definitely wouldn't be an issue.. They are still using the PTS timestamp so in theory it shouldn't be an issue.
Good point and since sync itself could potentially be throwing away video frames, the best spot for detelecine to operate would actually be before the sync process since missing video frames would jack with the pullup sequence. Like you said though, the PTS should still match up even if the muxer is receiving fewer video frames. Worth a shot at any rate...

Posted: Mon Sep 03, 2007 1:02 pm
by Conner
cvk_b wrote:
egor wrote:
Specifically, when I run a telecined movie through the detelecine process, the interlacing disappears (as expected), but the movie remains at 29.97 fps (giving a duplicate frame every fifth frame). I would have expected the process to drop the duplicate frame and render a 24 fps movie.
You're right. It's not discarding doubled frames... yet.
any idea when this might get fixed? not discarding the doubled frames makes the video playback choppy.

Posted: Mon Sep 03, 2007 3:10 pm
by Deke
Do you have Cinema Tools? That might work to delete the duplicate frames.
Deke

Posted: Mon Sep 03, 2007 4:50 pm
by Conner
Deke wrote:Do you have Cinema Tools? That might work to delete the duplicate frames.
Deke
so... after encoding with handbrake to mp4, I should run this file thru a $500 software package that might work to delete the duplicate frames?