VideoHelp Forum
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Member
    Join Date
    Dec 2017
    Location
    United Kingdom
    Search PM
    Hi,

    I was wondering what phase command I should use for inverting the field order of an NTSC video source in ffmpeg captured wrongly as TFF using hardware
    It is pure analog NTSC video but TFF was used by default during the capture process.

    phase = b or = phase t

    ??

    I was using fieldorder=bff but I understand that some blurring of chroma may be induced.
    Quote Quote  
  2. separate the fields, discard the 1st field, weave it back together
    Code:
    -vf setfield=tff,separatefields,trim=start_frame=1,weave,setfield=bff
    Quote Quote  
  3. Member
    Join Date
    Dec 2017
    Location
    United Kingdom
    Search PM
    Originally Posted by poisondeathray View Post
    separate the fields, discard the 1st field, weave it back together
    Code:
    -vf setfield=tff,separatefields,trim=start_frame=1,weave,setfield=bff
    This will give me pure interlaced video with bottom field first?
    Quote Quote  
  4. Originally Posted by cjdavis83 View Post
    Originally Posted by poisondeathray View Post
    separate the fields, discard the 1st field, weave it back together
    Code:
    -vf setfield=tff,separatefields,trim=start_frame=1,weave,setfield=bff
    This will give me pure interlaced video with bottom field first?

    If you started with pure interlaced content TFF, and your timestamps are ok , it should work. But sometimes ffmpeg produces unreliable results if the input timestamps have problems

    If you have problems, then you can use avisynth with a frame accurate source filter - and it will work for certain. Avisynth is more consistent for this type of work than ffmpeg

    Code:
    #Input
    AssumeTFF()
    SeparateFields()
    Trim(1,0)
    Weave()
    If you still have problems, post a stream copied video sample of the source
    Quote Quote  
  5. Member
    Join Date
    Dec 2017
    Location
    United Kingdom
    Search PM
    Originally Posted by poisondeathray View Post
    Originally Posted by cjdavis83 View Post
    Originally Posted by poisondeathray View Post
    separate the fields, discard the 1st field, weave it back together
    Code:
    -vf setfield=tff,separatefields,trim=start_frame=1,weave,setfield=bff
    This will give me pure interlaced video with bottom field first?

    If you started with pure interlaced content TFF, and your timestamps are ok , it should work. But sometimes ffmpeg produces unreliable results if the input timestamps have problems

    If you have problems, then you can use avisynth with a frame accurate source filter - and it will work for certain. Avisynth is more consistent for this type of work than ffmpeg

    Code:
    #Input
    AssumeTFF()
    SeparateFields()
    Trim(1,0)
    Weave()
    If you still have problems, post a stream copied video sample of the source
    Here is the TFF sample that was captured wrongly;

    https://drive.google.com/file/d/1jBa6BUfnov-4cxq-D2gmlNX6GqgcHo1K/view?usp=drivesdk
    Quote Quote  
  6. The ffmpeg command above does not work properly; You might have to use filter_complex and separatefields split the outputs into even and odd streams, trim 1st even, and interleave them back. It's tricky because it messes up the PTS, so you need a PTS expression. I'll play with it and see if I can get it to work

    avisynth works, as expected

    Code:
    LSmashVideoSource("longsample_480i_tff.mov")
    AssumeTFF()
    SeparateFields()
    Trim(1,0)
    Weave()
    AssumeBFF()
    (There are some experimental ffmpeg builds that accept avs properties, so if it was flagged BFF, that would be read as BFF instead of having to set it in ffmpeg)

    But to encode it with any ffmpeg build

    Code:
    ffmpeg -i bff.avs -i longsample_480i_tff.mov -map 0:0 -map 1:1 -flags +ildct+ilme -top 0 -vf setfield=bff -c:v prores -profile:v 3 -c:a copy avs_bff.mov -y
    So that results in content BFF, and en coded and flagged BFF

    But a question is why do you need BFF ? TFF is perfectly acceptable for SD content . You incur generation loss if you encode with lossy format like prores
    Quote Quote  
  7. Actually I forgot about these:

    -vf fieldorder
    -vf phase

    https://forum.videohelp.com/threads/365238-how-to-invert-field-order-with-ffmpeg

    This works ok
    Code:
    ffmpeg -i longsample_480i_tff.mov -vf "fieldorder=bff" -c:v prores -profile:v 3 -flags +ildct+ilme -top 0 -c:a copy output.mov
    -vf "phase=mode=t" worked mostly ok too, but there was a glitch in the 2nd field
    Last edited by poisondeathray; 28th Dec 2021 at 18:54.
    Quote Quote  



Similar Threads

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