'Interlace Detection' & 'Interlace'

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
musicvid
Veteran User
Posts: 3768
Joined: Sat Jun 27, 2009 1:19 am

Re: 'Interlace Detection' & 'Interlace'

Post by musicvid »

markfilipak wrote: Sat Sep 14, 2019 12:24 am p30-telecine is rare --
yep. scarce as hens' teeth, I'd say
User avatar
JohnAStebbins
HandBrake Team
Posts: 5583
Joined: Sat Feb 09, 2008 7:21 pm

Re: 'Interlace Detection' & 'Interlace'

Post by JohnAStebbins »

markfilipak wrote: Sat Sep 14, 2019 12:24 am Hey, John,

p30-telecine is rare -- I've only run across one -- but if the need arises and the source is known to originate from 24fps, how can I convert it to p24? I assume I would need to split fields to i30 first. Is that best done by directly invoking ffmpeg? Would I need to do the whole p30-telecine --> i30-telecine --> p24 via ffmpeg or is there a way to do a 2-stage process like that with HB?
I think your terminology may be confusing the matter. It sounds like you are talking about content that was originally converted to i30 telecine then encoded as progressive with visible combing in the progressive frames? HandBrake would treat this the same as i30.

The decoding process is the same for both progressive and interlaced content. HandBrake receives full frames from the decoder. In the case of interlaced content, there is combing visible in the frame due to the interlaced fields in the frame. The decoder also supplies flags to indicate that there are interlaced fields present, but HandBrake only uses these flags for handling soft telecine. In essence, what HandBrake sees for both interlaced and hard telecined content is a progressive frame in structure which has combing artefacts. The detelecine algroithm will remove the combing without loss of quality for hard telecine and the deinterlace algorithm will remove the combining with loss of quality (and loss of temporal information if the input frame was telecine).
markfilipak
Bright Spark User
Posts: 237
Joined: Thu Aug 01, 2019 8:58 pm

Re: 'Interlace Detection' & 'Interlace'

Post by markfilipak »

Because I adore HandBrake, I spent a long time crafting this reponse. I hope you find the time spent reading it fruitful.
JohnAStebbins wrote: Sat Sep 14, 2019 3:43 pm
markfilipak wrote: Sat Sep 14, 2019 12:24 am Hey, John,

p30-telecine is rare -- I've only run across one -- but if the need arises and the source is known to originate from 24fps, how can I convert it to p24? I assume I would need to split fields to i30 first. Is that best done by directly invoking ffmpeg? Would I need to do the whole p30-telecine --> i30-telecine --> p24 via ffmpeg or is there a way to do a 2-stage process like that with HB?
I think your terminology may be confusing the matter.
Gee, I hope not. Names matter. I needed to differentiate a 30fps stream that was derived from p24 (i.e., temporal frames) from a 30fps stream that was derived from camera (i.e., temporal fields), so I call the former "i30-telecine" (or "p30-telecine") and left the later as "i30" (or "p30"), though, for the later, I also favor the terms "i30-telecast" (or "p30-telecast").

I also needed a compact way to visualize the frame/field formats, so I created the notion that I previously presented
viewtopic.php?f=6&t=39355&sid=218dadae1 ... 72#p185860
which, now that I look at it, I see has a mistake: A 2nd line of "p30-telecine" got in there somehow. It's bogus. I think I was using the line between the 1st "p30-telecine" line and the "p24" line as a scratch pad and accidentally left it in. For that, I apologize. Perhaps I should recapitulate the table but with the correction:

Code: Select all

                i30 = [A][a][B][b][C][c][D][d][E][e]   ...out of an NTSC camera
         i30-bottom = [a][A][b][B][c][C][d][D][e][E]
                p30 = [A/a][B/b][C/c][D/d][E/e]
       i30-telecine = [A][a][B][b][B][c][C][d][D][d]   ...telecined from p24 movie film samples
i30-telecine-bottom = [a][A][b][B][b][C][c][D][d][D]   ...no sane video engineer would do this
       p30-telecine = [A/a][B/b][B/c][C/d][D/d]        ...rare, occasionally encountered
                p24 = [A/a][B/b][C/c][D/d]
It sounds like you are talking about content that was originally converted to i30 telecine then encoded as progressive with visible combing in the progressive frames?
How does p24 become p30-telecine? I don't know. I imagine that telecine is accomplished as you suggest:

Code: Select all

[A/a][B/b][C/c][D/d] --> [A][a][B][b][C][c][D][d] --> [A][a][B][b][B][c][C][d][D][d] --> [A/a][B/b][B/c][C/d][D/d]
And, yes, there's combing (a consequence of the temporal proximity of [B/_][_/d] when the [B/c] frame is immediately followed by the [C/d] frame).
HandBrake would treat this the same as i30.
I'm going to repond further down (i.e., not at this point) in order to address your next, very important statement.
The decoding process is the same for both progressive and interlaced content. HandBrake receives full frames from the decoder.
I'm glad you mentioned that. It brings up a point of unsurity for me. Do the HB devs consider

Code: Select all

[A/a][B/b][B/c][C/d][D/d]
to be interlaced or progressive? I've always thought that once the fields are combined into frames, the result is always termed "progressive", that the field-content loses it's identity as a discrete thingy. ...It may seem an esoteric point, but it's a point of confusion when folks throw around the words "progressive" & "interlaced" casually. To me, interlacing is a process a (digital) display device employs in response to non-interlaced, discrete-field input. Unfortunately, the process of converting i30 to p30 is called "deinterlace" (not "interlacing", though it's the same as what the display device does). The terminology stinks, but we're stuck with it. Does that give you some insight regarding how ordinary users can get confused? It would be better if i30 were called "non-interlaced" (or better, "discrete-field"), but so be it ...it is what it is.
In the case of interlaced content, there is combing visible in the frame due to the interlaced fields in the frame.
Well, you see, that statement cannot be fully correct. I intend no offense -- I have utmost respect for you -- and I'm not nit-picking. The combing isn't caused by the presence of interlaced fields, per se. It's caused by the 2-3 pull-down that's employed during telecine.
The decoder also supplies flags to indicate that there are interlaced fields present, but HandBrake only uses these flags for handling soft telecine. In essence, what HandBrake sees for both interlaced and hard telecined content is a progressive frame in structure which has combing artefacts. The detelecine algroithm will remove the combing without loss of quality for hard telecine and the deinterlace algorithm will remove the combining with loss of quality (and loss of temporal information if the input frame was telecine).
Do professional studio engineers make unrecoverable mastering mistakes when authoring DBs & DVDs? Sure they do. I could cite some examples. They sometimes make mistakes, and those mistakes make detelecining that content impossible and make the result worse than the source (e.g., really, really bad combing). Did those engineers make their mistakes because they were 'wiring' filter stacks via library calls without a clear vision regarding the underlaying, real video effects of those library calls? I suspect so. Did their lack of vision result from misunderstanding caused by poor terminology? I think so.

Words matter. Names matter. Precise terminology and clear notational methods matter. I can help. John, you are the gateway to the HB devs. I love, truly love HandBrake. I want to help. I can help. I have the time to help. I am qualified to help. Can I help?

Now, regarding
HandBrake would treat this the same as i30.
I assume you mean HB treats p30-telecined sources & i30-telecined sources the same way? Can you be more specific? Since I have been led to believe that HB only does detelecine (not telecine), I'm unsure how to interpret what you wrote. ...Or, if I specify a 30fps target, does HB also telecine? ... Never mind, I can run an experiment to determine that.

I enjoy our discussions.
musicvid
Veteran User
Posts: 3768
Joined: Sat Jun 27, 2009 1:19 am

Re: 'Interlace Detection' & 'Interlace'

Post by musicvid »

Pardon my naivete. I may have figured out your verbiage.
Is this what you're talking about?
https://www.youtube.com/watch?v=vJuSFUc1FYM
As in "formerly" telecine as processed by YouTube? I just helped a guy through this archiving puzzle (sans moniker) in February, using Handbrake.
Turns out Handbrake already deconstructs these fourth-generation abominations (aka "Frankenfiles") perfectly, at least as far as can be physically salvaged. I can show you how if you like.
https://s3.eu-central-1.amazonaws.com/l ... ED4055.mp4
Has nothing to do with production source, really. It does have to do with Film->5-blade aerial capture->Interlaced AVI DV25->Youtube upload. Not exactly rare, but not studio engineering error, either, not by at least two or three generations.
Sadly, Youtube does not recognize nor address pulldown or duplicate frames; fortunately for you and me, Handbrake does this already, and has at least as far back as 0.10.1 (I tested it).
https://www.vegascreativesoftware.info/ ... NRLX4N0M0G
Tempest in a teacup.
Last edited by musicvid on Sun Sep 15, 2019 5:04 pm, edited 11 times in total.
rollin_eng
Veteran User
Posts: 3612
Joined: Wed May 04, 2011 11:06 pm

Re: 'Interlace Detection' & 'Interlace'

Post by rollin_eng »

musicvid wrote: Sun Sep 15, 2019 7:08 am Pardon my naivete.
Is this what you're talking about?
Maybe Handbrake shouldn't be dealing with
I think someone needs to step away from their keyboard.

No wonder modern education is considered sub par.
User avatar
BradleyS
Moderator
Posts: 1859
Joined: Thu Aug 09, 2007 12:16 pm

Re: 'Interlace Detection' & 'Interlace'

Post by BradleyS »

Soft telecine is used a lot on DVDs. This is where the video is 24p throughout, but flagged as interlaced 30i and containing repeat field flags as well, so players could output 30i to SD televisions with no effort. HandBrake, naturally, ignores these flags and operates on the 24p source with no additional filters required.

Hard telecine is the same concept but instead of using signaling to tell the player how to create 30i from 24p, it's baked into the picture somewhat permanently. So the storage format, instead of being 24p with extra field signaling, is 30i with no additional signaling. And often times for non-disc formats, it isn't even signaled as interlaced, so it's technically 30p. But the field trickery created by the telecine is there, regardless of whether the video is 30i or 30p.

Anyway, HandBrake can reverse this baked-in hard telecine using the detelecine filter, assuming the fields have a normal repeating cadence. It's analysis-based so it should work regardless of whether the video is 30i or 30p; the content is identical if it's truly a 24p source telecine'd to 30 fps.
musicvid
Veteran User
Posts: 3768
Joined: Sat Jun 27, 2009 1:19 am

Re: 'Interlace Detection' & 'Interlace'

Post by musicvid »

+1
And Handbrake already catches its share of red herring, no need to reimagine it just to protect amateur recoders from themselves.
markfilipak
Bright Spark User
Posts: 237
Joined: Thu Aug 01, 2019 8:58 pm

Re: 'Interlace Detection' & 'Interlace'

Post by markfilipak »

musicvid wrote: Mon Sep 16, 2019 12:55 am +1
And Handbrake already catches its share of red herring, no need to reimagine it just to protect amateur recoders from themselves.
musicvid, you crack me up. Do you do a lot of work for amateur authors?
markfilipak
Bright Spark User
Posts: 237
Joined: Thu Aug 01, 2019 8:58 pm

Re: 'Interlace Detection' & 'Interlace'

Post by markfilipak »

BradleyS wrote: Sun Sep 15, 2019 11:45 pm Soft telecine is used a lot on DVDs...
I see the change around 2002. I've always attibuted the improved resolution of newer DVDs to higher res sampling (i.e., for BD ... Nyquist and all that you know), but I guess lower compression enabled by improved storage utiization enters into it, too. Thanks for the insight.
musicvid
Veteran User
Posts: 3768
Joined: Sat Jun 27, 2009 1:19 am

Re: 'Interlace Detection' & 'Interlace'

Post by musicvid »

markfilipak wrote: Mon Sep 16, 2019 2:05 am
musicvid wrote: Mon Sep 16, 2019 12:55 am +1
And Handbrake already catches its share of red herring, no need to reimagine it just to protect amateur recoders from themselves.
musicvid, you crack me up. Do you do a lot of work for amateur authors?
Only when they want to be helped.
markfilipak
Bright Spark User
Posts: 237
Joined: Thu Aug 01, 2019 8:58 pm

Re: 'Interlace Detection' & 'Interlace'

Post by markfilipak »

musicvid wrote: Mon Sep 16, 2019 2:34 pm
markfilipak wrote: Mon Sep 16, 2019 2:05 am
musicvid wrote: Mon Sep 16, 2019 12:55 am +1
And Handbrake already catches its share of red herring, no need to reimagine it just to protect amateur recoders from themselves.
musicvid, you crack me up. Do you do a lot of work for amateur authors?
Only when they want to be helped.
Oh, sorry. I thought you did commercial work.
musicvid
Veteran User
Posts: 3768
Joined: Sat Jun 27, 2009 1:19 am

Re: 'Interlace Detection' & 'Interlace'

Post by musicvid »

markfilipak wrote: Mon Sep 16, 2019 2:57 pm
musicvid wrote: Mon Sep 16, 2019 2:34 pm
markfilipak wrote: Mon Sep 16, 2019 2:05 am
musicvid wrote: Mon Sep 16, 2019 12:55 am +1
And Handbrake already catches its share of red herring, no need to reimagine it just to protect amateur recoders from themselves.
musicvid, you crack me up. Do you do a lot of work for amateur authors?
Only when they want to be helped.
Oh, sorry. I thought you did commercial work.
Yes. And you?
markfilipak
Bright Spark User
Posts: 237
Joined: Thu Aug 01, 2019 8:58 pm

Re: 'Interlace Detection' & 'Interlace'

Post by markfilipak »

musicvid wrote: Mon Sep 16, 2019 3:32 pm
markfilipak wrote: Mon Sep 16, 2019 2:57 pm
musicvid wrote: Mon Sep 16, 2019 2:34 pm
markfilipak wrote: Mon Sep 16, 2019 2:05 am
musicvid wrote: Mon Sep 16, 2019 12:55 am +1
And Handbrake already catches its share of red herring, no need to reimagine it just to protect amateur recoders from themselves.
musicvid, you crack me up. Do you do a lot of work for amateur authors?
Only when they want to be helped.
Oh, sorry. I thought you did commercial work.
Yes. And you?
I'm retired from circuit & chip design.
markfilipak
Bright Spark User
Posts: 237
Joined: Thu Aug 01, 2019 8:58 pm

Re: 'Interlace Detection' & 'Interlace'

Post by markfilipak »

musicvid wrote: Sun Sep 15, 2019 7:08 am Pardon my naivete. I may have figured out your verbiage.
Is this what you're talking about?
https://www.youtube.com/watch?v=vJuSFUc1FYM
I don't know. I block google and google owns youtube, so youtube doesn't play for me.
As in "formerly" telecine as processed by YouTube? I just helped a guy through this archiving puzzle (sans moniker) in February, using Handbrake.
Turns out Handbrake already deconstructs these fourth-generation abominations (aka "Frankenfiles") perfectly, at least as far as can be physically salvaged. I can show you how if you like.
https://s3.eu-central-1.amazonaws.com/l ... ED4055.mp4
I can't see it. I block amazon, too.
They must be using google spyware too. I can't play that either.
Tempest in a teacup.
Did you ever see the Star Trek TNG episode "Darmok"? You're really from planet Tamaria, aren't you?
User avatar
BradleyS
Moderator
Posts: 1859
Joined: Thu Aug 09, 2007 12:16 pm

Re: 'Interlace Detection' & 'Interlace'

Post by BradleyS »

This thread has run its course and gone way off topic. Gentlemen, feel free to continue your personal discussion in private.
Locked