VideoHelp Forum
+ Reply to Thread
Results 1 to 12 of 12
Thread
  1. I have some footage that is 25fps progressive but edited with 50i fades, wipes, and credits.
    The footage is 1080p/i.
    What is the best way to deinterlace only the interlaced version, so as to preserve the original quality as best as possible.

    My initial thoughts are just to use QTGMC Very Fast, but I would rather just deinterlace the fades/wipes (with a lesser deinterlacing filter if necessary).

    Thank You.
    Quote Quote  
  2. You can use a deinterlacer that only deinterlaces the frames it sees as interlaced. One choice is:

    TDeint(Full=False)

    It can also be changed to use the deinterlacer of your choice (like QTGMC(FPSDivisor=2)) if you prefer. Vinverse is another choice to deinterlace only that which is interlaced.
    Last edited by manono; 13th Dec 2020 at 17:56.
    Quote Quote  
  3. Yadif (with deint 1). See https://ffmpeg.org/ffmpeg-filters.html#yadif-1
    (Only deinterlace frames marked as interlaced).
    You could try my clever FFmpeg-GUI for this.
    Quote Quote  
  4. Sorry, double post
    Quote Quote  
  5. Originally Posted by ProWo View Post
    (Only deinterlace frames marked as interlaced).
    If it's typical PAL, they're all marked as interlaced. One thing is sure, though, and that is only the real interlaced frames won't be marked as interlaced. Either they all will or they all won't. That setting is useless.
    Quote Quote  
  6. Sadly but true, often relying on flags when it comes to interlacing is a lost cause.
    My old PAL Harry Potter DVD has all streams flagged as TFF, but looking at the content, aside from a small trailer in the extras, everything on that disc is progressive.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  7. In that ffmpeg yadif context, "marked as interlaced" is supposed to refer to an internal ffmpeg decision, such as after -vf fieldmatch, where there might be some residual combing or leftover "interlaced" frames. It does not use the file's encoding parameters, metadata or flagging to decide whether to mark a frame as "interlaced" . (It would be analgous to TFM(pp=something, cthresh=something) , where deinterlace is only applied when combing threshold conditions are met) . The ffmpeg documentation isn't great, but it's like an 20 story library compared to what it once was

    And if you keep it all 25p , you throw away 1/2 the data in the interlaced sections . You could argue full motion samples is part of "original quality". You'd have to make it VFR to "preserve the original quality as best as possible."
    Last edited by poisondeathray; 15th Dec 2020 at 10:40.
    Quote Quote  
  8. Originally Posted by poisondeathray View Post
    In that ffmpeg yadif context, "marked as interlaced" is supposed to refer to an internal ffmpeg decision, such as after -vf fieldmatch, where there might be some residual combing or leftover "interlaced" frames. It does not use the file's encoding parameters, metadata or flagging to decide whether to mark a frame as "interlaced"
    Yadif as used in AviSynth (and Handbrake and VDub?) doesn't check if a frame is interlaced before deinterlacing it. Nor does the link ProWo supplied state, or even imply, that the Deint=1 setting does a check before deciding to deinterlace it. Unless you can provide some better documentation that it does check, I'd respectfully disagree.
    Quote Quote  
  9. Originally Posted by manono View Post
    Originally Posted by poisondeathray View Post
    In that ffmpeg yadif context, "marked as interlaced" is supposed to refer to an internal ffmpeg decision, such as after -vf fieldmatch, where there might be some residual combing or leftover "interlaced" frames. It does not use the file's encoding parameters, metadata or flagging to decide whether to mark a frame as "interlaced"
    Yadif as used in AviSynth (and Handbrake and VDub?) doesn't check if a frame is interlaced before deinterlacing it. Nor does the link ProWo supplied state, or even imply, that the Deint=1 setting does a check before deciding to deinterlace it. Unless you can provide some better documentation that it does check, I'd respectfully disagree.
    Not the avisynth or vdub version, because it does not communicate with the upstream filter (yet; avisynth is starting to get frame properties like vapoursynth , and some avs filters have started to be modernized for this )

    For ffmpeg, it's used for combed frame fallback from a preceding filter

    https://ffmpeg.org/ffmpeg-filters.html#fieldmatch

    If the source has mixed telecined and real interlaced content, fieldmatch will not be able to match fields for the interlaced parts. But these remaining combed frames will be marked as interlaced, and thus can be de-interlaced by a later filter such as yadif before decimation.


    Advanced IVTC, with fallback on yadif for still combed frames:

    fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
    If you check with the debug mode, certain frames from fieldmatch filter are marked as "combed", those are the only ones that get filtered by yadif

    If it's still interlaced, the internal "flag" is combed YES vs. NO , and that gets passed to yadif . If yadif is set to deint=1, the YES marked ones get filtered by yadif . If deint=0, it acts like avisynth yadif version , where every frame is deinterlaced by yadif (ignores the flag and processes every frame)

    A snippet looks like this,

    Code:
    [Parsed_fieldmatch_0 @ 000000013daa2100] Frame #2 at 0.0667333 is still interlaced
    [Parsed_fieldmatch_0 @ 000000013daa2100] SC:0 | COMBS:  -1 232 232  -1  -1 (combpel=80) match=1 combed=YES
    cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [rawvideo @ 000000015bd9d340] PACKET SIZE: 1036800, STRIDE: 2160
    [Parsed_fieldmatch_0 @ 000000013daa2100] SC:0 | COMBS:  13  -1 256  -1  -1 (combpel=80) match=0 combed=NO
    .
    .
    .
    Last edited by poisondeathray; 15th Dec 2020 at 14:47.
    Quote Quote  
  10. ProWo didn't mention any previous filter. The link he included didn't mention it either. Apparently, it's that filter (the field matcher) which does the check for interlacing and marks the frame for Yadif to come along afterwards to deinterlace. Ordinarily, for a 25fps video such as this, one wouldn't use a field matcher as something like 99% of this video is already progressive. However, what you write does make sense and I suppose it's possible to use Yadif for this if preceded by a field matcher. So, thank you for tracking the method down.

    Then there's the problem of Yadif, which only has speed going for it, and whose quality leaves a lot to be desired. I'd much prefer to go with something like:

    Orig = QTGMC(FPSDivisor=2)
    TDeint(Full=False, Clip2=Orig)
    Quote Quote  
  11. Yes, the ffmpeg documentation sucks and incomplete - I was just trying to clarify how deint=1 is supposed to be used in the ffmpeg context

    deint=1 seems to only work as expected when you have a preceding fieldmatch filter that passes on the data. I double checked this - I was wrong about "does not use the file's encoding parameters, metadata or flagging" - If you feed use yadif=deint=1 only, without a preceding filter that has interlace/comb detection, and input file is flagged interlaced- all frames get deinterlaced. So a progressive content "PAL" DVD - just encoded and flagged interlaced like many are - when using yadif=deint=1 does get degraded. It does not get degraded when preceded by fieldmatch . So in cases like this you'd have to use it with fieldmatch, or else progressive frames get degraded.

    A progressive content file (flagged progressive or not flagged) does not get degraded with yadif=deint=1, and a pure interlace content file, flagged interlaced gets deinterlaced. So that suggests the file interlaced/progressive metadata or encoding type plays a role, unless fieldmatch "marked as" data overrides it.



    Yes, yadif quality is not good. If someone was going to use ffmpeg, bwdif is slightly better in terms of quality and actually faster (!) . It has deint=1 mode too (where only frames "marked as interlaced"...all ffmpeg deinterlacers do). Both pale in comparison to QTGMC quality for general use cases
    Quote Quote  
  12. I'm a bit late getting back to this, but thanks for all the discussion.

    I gave ffmpeg a go with
    Code:
    -vf "fieldmatch=order=tff:combmatch=full, bwdif=deint=interlaced"
    In this particular case I wasn't worried for quality of deinterlacing as it is 99% progressive, so the lower quality deinterlacing in the odd screen wipe was nothing to worry about.

    It also seems to successfully preserve the progressive frames (comparing frame captures showed no difference (for testing I saved losslessly)).

    I'll keep note of the QTGMC based method for much more heavily mixed content, where quality would become more of a factor.
    Last edited by ajingo; 17th Dec 2020 at 11:21.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!