VideoHelp Forum
+ Reply to Thread
Results 1 to 13 of 13
Thread
  1. Member
    Join Date
    Nov 2008
    Location
    United States
    Search Comp PM
    I've been experimenting with this now for over a week.

    I'm using Hybrid for everything that's not just the FFmpeg command line.

    Here's a frame from a 50 fps progressive interlaced PAL DVD (720:576, 25 fps full frame). It's anamorphic 16:9, but I have not "desqueezed" this, it's 1:1.

    DVD is 1:1 ripped and put into mkv container. Audio stream discarded for test.


    FFmpeg on command line at default (nothing specified for deinterlacing):


    ffmpeg.exe -fflags +genpts -i "input.mkv" -profile:v high -level 4.2 -preset veryslow -crf 8 "output.mp4"


    Hybrid using ffmpeg deinterlacer option:




    Hybrid using Yadifmod:




    Hybrid using QTGMC with no smoothing (worst result):




    Hybrid using QTGMC with smoothing set to 1:




    Looking at the old dude's hair, aliasing/ringing artifacts around the dark suit shoulders and fine detail, FFmpeg seems to be giving the superior results here.


    Hybrid x264 encoding is set to the same as FFMpeg:



    I know Hybrid has a reputation for having bugs that produce wrong scripts, in this case I checked all the Vaporsynth scripts and cross referenced to the various wikis and all options and flags seemed to be set correctly.

    What is FFMpeg actually doing to deinterlace when no options are specified?

    This frame was extracted with ffmpeg -i frame.mp4 -r 1/1 frame%06d.png. It's the same frame number and the output videos all have the exact same length and number of frames as the original (full frames), so I'm not sure why some of the results have slightly offset frames.

    If you save these images and prefix them with 01, 02, etc., and open them in irfanview, and use the space bar to backspace key to advance each image, you can compare the results much easier. Resize the images 3 or 4 times using lanczos to see finer detail better.

    Thoughts? Anything I'm missing or doing wrong? I'm at the point now where I just feel it's best to use FFmpeg without any interlacing options set to go to x264 and let it deinterlace with its default settings (whatever they are).
    Last edited by Corvius; 16th Mar 2020 at 13:14.
    Quote Quote  
  2. Originally Posted by Corvius View Post
    Anything I'm missing or doing wrong?
    You're not providing a short video sample cut from the DVD. Not an MKV but an M2V cut maybe using DGIndex.
    Quote Quote  
  3. Originally Posted by Corvius View Post
    Here's a frame from a 50 fps progressive interlaced PAL DVD (720:576, 25 fps full frame).

    ….. FFmpeg seems to be giving the superior results.

    ……. What is FFMpeg actually doing to deinterlace when no options are specified?

    …..I just feel it's best to use FFmpeg without any interlacing options …....
    What exactly do you mean with '50fps progressive interlaced PAL DVD'? Do you mean progressive video content, encoded (or flagged) as interlaced?
    If the video is progressive (I assume it is, but I might be wrong) it should NOT be deinterlaced. In your first example the ffmpeg commandline does not deinterlace, which makes sense.
    As has been suggested by manono, please upload a sample of a few seconds duration of the original.
    Quote Quote  
  4. Member
    Join Date
    Nov 2008
    Location
    United States
    Search Comp PM
    Clip from ripped VOB files, no reencoding.

    Code:
    General
    Count                                    : 331
    Count of stream of this kind             : 1
    Kind of stream                           : General
    Kind of stream                           : General
    Stream identifier                        : 0
    Count of video streams                   : 1
    Video_Format_List                        : MPEG Video
    Video_Format_WithHint_List               : MPEG Video
    Codecs Video                             : MPEG Video
    Complete name                            : E:\USER\fin\IFD\DVD Source\orig_dvd_clip.m2v
    Folder name                              : E:\USER\fin\IFD\DVD Source
    File name extension                      : orig_dvd_clip.m2v
    File name                                : orig_dvd_clip
    File extension                           : m2v
    Format                                   : MPEG Video
    Format                                   : MPEG Video
    Format/Extensions usually used           : mpgv mpv mp1v m1v mp2v m2v
    Commercial name                          : MPEG Video
    Format version                           : Version 2
    Internet media type                      : video/MPV
    File size                                : 4649286
    File size                                : 4.43 MiB
    File size                                : 4 MiB
    File size                                : 4.4 MiB
    File size                                : 4.43 MiB
    File size                                : 4.434 MiB
    Duration                                 : 9880
    Duration                                 : 9 s 880 ms
    Duration                                 : 9 s 880 ms
    Duration                                 : 9 s 880 ms
    Duration                                 : 00:00:09.880
    Duration                                 : 00:00:09:22
    Duration                                 : 00:00:09.880 (00:00:09:22)
    Overall bit rate mode                    : VBR
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 3764604
    Overall bit rate                         : 3 765 kb/s
    Frame rate                               : 25.000
    Frame rate                               : 25.000 FPS
    Frame count                              : 247
    Stream size                              : 0
    Stream size                              : 0.00 Byte (0%)
    Stream size                              :  Byte0
    Stream size                              : 0.0 Byte
    Stream size                              : 0.00 Byte
    Stream size                              : 0.000 Byte
    Stream size                              : 0.00 Byte (0%)
    Proportion of this stream                : 0.00000
    File creation date                       : UTC 2020-03-16 22:33:55.917
    File creation date (local)               : 2020-03-16 18:33:55.917
    File last modification date              : UTC 2020-03-16 22:34:13.547
    File last modification date (local)      : 2020-03-16 18:34:13.547
    
    Video
    Count                                    : 378
    Count of stream of this kind             : 1
    Kind of stream                           : Video
    Kind of stream                           : Video
    Stream identifier                        : 0
    Format                                   : MPEG Video
    Format                                   : MPEG Video
    Commercial name                          : MPEG-2 Video
    Format version                           : Version 2
    Format profile                           : Main@Main
    Format settings                          : BVOP
    Format settings, BVOP                    : Yes
    Format settings, BVOP                    : Yes
    Format settings, Matrix                  : Default
    Format settings, Matrix                  : Default
    Format settings, GOP                     : M=3, N=13
    Format settings, picture structure       : Frame
    Internet media type                      : video/MPV
    Duration                                 : 9880
    Duration                                 : 9 s 880 ms
    Duration                                 : 9 s 880 ms
    Duration                                 : 9 s 880 ms
    Duration                                 : 00:00:09.880
    Duration                                 : 00:00:09:22
    Duration                                 : 00:00:09.880 (00:00:09:22)
    Bit rate mode                            : VBR
    Bit rate mode                            : Variable
    Bit rate                                 : 3764604
    Bit rate                                 : 3 765 kb/s
    Maximum bit rate                         : 8500000
    Maximum bit rate                         : 8 500 kb/s
    Width                                    : 720
    Width                                    : 720 pixels
    Height                                   : 576
    Height                                   : 576 pixels
    Sampled_Width                            : 720
    Sampled_Height                           : 576
    Pixel aspect ratio                       : 1.896
    Display aspect ratio                     : 2.370
    Display aspect ratio                     : 2.40:1
    Frame rate                               : 25.000
    Frame rate                               : 25.000 FPS
    Frame count                              : 247
    Standard                                 : PAL
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8
    Bit depth                                : 8 bits
    Scan type                                : Interlaced
    Scan type                                : Interlaced
    Scan order                               : TFF
    Scan order                               : Top Field First
    Compression mode                         : Lossy
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 0.363
    Delay                                    : 6010240
    Delay                                    : 1 h 40 min
    Delay                                    : 1 h 40 min 10 s 240 ms
    Delay                                    : 1 h 40 min
    Delay                                    : 01:40:10.240
    Delay_Settings                           : drop_frame_flag=0 / closed_gop=0 / broken_link=0
    Delay_DropFrame                          : No
    Delay, origin                            : Stream
    Delay, origin                            : Raw stream
    Time code of first frame                 : 01:40:10:06
    GOP, Open/Closed                         : Open
    GOP, Open/Closed                         : Open
    Stream size                              : 4649286
    Stream size                              : 4.43 MiB (100%)
    Stream size                              : 4 MiB
    Stream size                              : 4.4 MiB
    Stream size                              : 4.43 MiB
    Stream size                              : 4.434 MiB
    Stream size                              : 4.43 MiB (100%)
    Proportion of this stream                : 1.00000
    Buffer size                              : 229376
    colour_description_present               : Yes
    colour_description_present_Source        : Stream
    Color primaries                          : BT.601 PAL
    colour_primaries_Source                  : Stream
    Transfer characteristics                 : BT.470 System B/G
    transfer_characteristics_Source          : Stream
    Matrix coefficients                      : BT.470 System B/G
    matrix_coefficients_Source               : Stream
    intra_dc_precision                       : 10
    Image Attached Files
    Quote Quote  
  5. As I suspected your video is progressive and should therefore not be deinterlaced. Any forced deinterlacing does just worsen the quality. It was encoded and flagged as interlaced for DVD standards compliance only.
    Quote Quote  
  6. Member
    Join Date
    Nov 2008
    Location
    United States
    Search Comp PM
    [QUOTE=Sharc;2576633]
    Originally Posted by Corvius View Post
    If the video is progressive (I assume it is, but I might be wrong) it should NOT be deinterlaced. In your first example the ffmpeg commandline does not deinterlace, which makes sense.
    The sample video below isn't mine, but it came from a forum where someone posted a capture of a "true" captured analog interleaved signal.

    If I run the ffmpeg command on it:

    ffmpeg.exe -fflags +genpts -i "Example_Interlaced.avi" -profile:v high -level 4.2 -preset veryslow -crf 8 -vf format=yuv420p "Example_Interlaced.mp4"

    ...it does deinterlace it.

    Edit - OK, while it does convert it to "progressive" it obviously didn't really deinterlace it because there are combing artifacts all over the result. :P
    Image Attached Files
    Last edited by Corvius; 16th Mar 2020 at 18:03.
    Quote Quote  
  7. Member
    Join Date
    Nov 2008
    Location
    United States
    Search Comp PM
    Originally Posted by Sharc View Post
    As I suspected your video is progressive and should therefore not be deinterlaced. Any forced deinterlacing does just worsen the quality. It was encoded and flagged as interlaced for DVD standards compliance only.
    I admit I'm not an expert in this, I always understood "all DVD's are interlaced."

    Can you please share how you are able to tell that a DVD's video is "progressive and should not be deinterlaced" for someone like me who is confused on this point.
    Quote Quote  
  8. [QUOTE=Corvius;2576637][QUOTE=Sharc;2576633]
    Originally Posted by Corvius View Post
    If the video is progressive (I assume it is, but I might be wrong) it should NOT be deinterlaced. In your first example the ffmpeg commandline does not deinterlace, which makes sense.
    The sample video below isn't mine, but it came from a forum where someone posted a capture of a "true" captured analog interleaved signal.

    If I run the ffmpeg command on it:

    ffmpeg.exe -fflags +genpts -i "Example_Interlaced.avi" -profile:v high -level 4.2 -preset veryslow -crf 8 -vf format=yuv420p "Example_Interlaced.mp4"

    ...it does deinterlace it.
    No. Your commandline creates an interlaced video from the interlaced source. It's your PLAYER which deinterlaces it.
    Quote Quote  
  9. Originally Posted by Corvius View Post
    I always understood "all DVD's are interlaced."
    You understood wrong. While virtually all PAL DVDs are encoded as interlaced, the content itself is often progressive. You don't look at the interlaced flag but the frames to determine whether or not your DVD is interlaced.

    The story is somewhat different for NTSC DVDs.

    Can you please share how you are able to tell that a DVD's video is "progressive and should not be deinterlaced" for someone like me who is confused on this point.
    You open the video in something that doesn't deinterlace by default. You find a place with movement and advance a frame at a time. If you don't see any interlacing, then it's not interlaced. Many of us use AviSynth scripts opened in Virtual Dub. You can probably open a VOB in VDub2 and do the same thing.
    Quote Quote  
  10. Originally Posted by Corvius View Post
    Can you please share how you are able to tell that a DVD's video is "progressive and should not be deinterlaced" for someone like me who is confused on this point.
    Separate the fields (or bob deinterlace) and step through the pictures. Select a scene with motion.
    If there is motion between the pictures (like a b c d e ….)your video is interlaced.
    If every picture has a duplicate (like aa bb cc dd …..) the video is progressive.

    avisynth script:
    Code:
    ….your source filter here ….
    assumeTFF()  #or assume BFF
    separatefields()  # or use a bobber
    Edit:
    or use manono's method. It's simpler
    Quote Quote  
  11. Originally Posted by Sharc View Post
    or use manono's method. It's simpler
    But yours is more thorough as it'll catch phase-shifted videos as well. I decided not to go into that but just answer the fellow's question so he could do it himself as easily as possible.

    It doesn't look as if he uses AviSynth so using VDub2 for the job should be pretty easy for him. Or a non-deinterlacing player.
    Quote Quote  
  12. Member
    Join Date
    Nov 2008
    Location
    United States
    Search Comp PM
    Well, this is embarrassing. FFMpeg looks best because it didn't deinterlace, because my content was not interlaced.

    I found this, in addition to the above posts, I found it to be extremely helpful.

    https://tommycatkins.com/2020/Neuron2_Video_Frame_Structure.htm
    Quote Quote  
  13. Btw. for encoding your interlaced 'Example_interlaced.avi' correctly as interlaced your ffmpeg commandline should be like
    Code:
    ffmpeg.exe -i "Example_Interlaced.avi" -flags +ilme+ildct -top 1 -profile:v high -level 4.0 -preset veryslow -crf 18 -vf format=yuv420p "Example_Interlaced.mp4"
    Otherwise the encode would be interlaced but flagged as progressive which would fool your player.

    Edit:
    And once we are at it:
    For single rate (29.97fps) deinterlacing you could try
    Code:
    ffmpeg.exe  -i "Example_interlaced.avi" -preset slow -crf 18 -filter:v "bwdif=mode=0, format=yuv420p" "Example_deinterlaced.mp4"
    For bobbing (double rate deinterlacing, 59.94fps) you could try
    Code:
    ffmpeg.exe -i "Example_interlaced.avi" -preset slow -crf 18 -filter:v "bwdif=mode=1, format=yuv420p" "Example_bobbed.mp4"
    Last edited by Sharc; 17th Mar 2020 at 05:34.
    Quote Quote  



Similar Threads

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