Answers.Body: <p>Add the yadif filter i.e.</p>
  <pre><code>ffmpeg -i input.vob -vf yadif -c:v libx264 -preset slow -crf 19 -c:a aac -b:a 256k output.mp4
  </code></pre>
  <p>See <a href="https://ffmpeg.org/ffmpeg-filters.html#yadif-1" rel="noreferrer">yadif docs</a> for more info.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-25T22:54:10.300Z
Answers.Text: From empirical comparison I think the bwdif deinterlacing algorithm is superior to yadif, however QTGMC is superior to all of those. If you have to stick with FFmpeg, the nnedi filter is definitely superior [but at the cost of *massive* reduction in processing speed](https://www.reddit.com/r/ffmpeg/comments/d3cwxp/what_is_the_difference_between_bwdif_and_yadif1/). What is your use case, how critical is rendering time and must you stick with FFmpeg or could you branch out into other tools which use FFmpeg along with other things like Vapoursynth?
Answers.UserDisplayName: Chris Woods
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-09T11:46:47.657Z
Answers.Text: `-vf yadif_cuda` if you have NVidia and CUDA installed.
Answers.UserDisplayName: Michał Leon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-06T18:32:29.477Z
Answers.Text: To expand on Woods' comment, QTGMC, by default, uses nnedi to deint. What makes QTGMC special is the extra filtering it does before and after nnedi. It also has presets to make it easy to use without fiddling with settings for days. nnedi can be 4x slower or more if you turn off the prescreener--which is not suggested because it gains you little. Otherwise, ffmpeg's default nnedi slowed my overall job by only 25% vs bwdif default. Without QTGMC, nnedi is slightly better than bwdif. With QTGMC, it is massively better. Hybrid makes QTGMC easy: https://forum.videohelp.com/threads/401770
Answers.UserDisplayName: juanitogan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2016-01-14T17:13:33.847Z
Answers.LastActivityDate: 2020-08-13T06:19:47.757Z
Answers.LastEditDate: 2020-08-13T06:19:47.757Z
Answers.UserDisplayName: Gyan
Body: <p>I have the following VOB file:</p>
  
  <p>→ <code>ffmpeg -i input.vob</code> output:</p>
  
  <pre><code>ffmpeg version N-77455-g4707497 Copyright (c) 2000-2015 the FFmpeg developers
    built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
    configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libdcadec --enable-libfreetype --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
    libavutil      55. 11.100 / 55. 11.100
    libavcodec     57. 20.100 / 57. 20.100
    libavformat    57. 20.100 / 57. 20.100
    libavdevice    57.  0.100 / 57.  0.100
    libavfilter     6. 21.101 /  6. 21.101
    libavresample   3.  0.  0 /  3.  0.  0
    libswscale      4.  0.100 /  4.  0.100
    libswresample   2.  0.101 /  2.  0.101
    libpostproc    54.  0.100 / 54.  0.100
  Input #0, mpeg, from 'input.vob':
    Duration: 00:31:36.96, start: 0.335967, bitrate: 6517 kb/s
      Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bt470bg), 720x576 [SAR 64:45 DAR 16:9], max. 9800 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
      Stream #0:1[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
  </code></pre>
  
  <p>→ <code>mediainfo input.vob</code> output:</p>
  
  <pre><code>General
  Complete name                            : input.vob
  Format                                   : MPEG-PS
  File size                                : 1.44 GiB
  Duration                                 : 31mn 36s
  Overall bit rate mode                    : Variable
  Overall bit rate                         : 6 518 Kbps
  
  Video
  ID                                       : 224 (0xE0)
  Format                                   : MPEG Video
  Format version                           : Version 2
  Format profile                           : Main@Main
  Format settings, BVOP                    : Yes
  Format settings, Matrix                  : Default
  Format settings, GOP                     : M=3, N=12
  Format settings, picture structure       : Frame
  Duration                                 : 31mn 36s
  Bit rate mode                            : Variable
  Bit rate                                 : 6 132 Kbps
  Maximum bit rate                         : 9 800 Kbps
  Width                                    : 720 pixels
  Height                                   : 576 pixels
  Display aspect ratio                     : 16:9
  Frame rate                               : 25.000 fps
  Standard                                 : PAL
  Color space                              : YUV
  Chroma subsampling                       : 4:2:0
  Bit depth                                : 8 bits
  Scan type                                : Interlaced
  Scan order                               : Top Field First
  Compression mode                         : Lossy
  Bits/(Pixel*Frame)                       : 0.591
  Time code of first frame                 : 00:00:00:00
  Time code source                         : Group of pictures header
  Stream size                              : 1.35 GiB (94%)
  Color primaries                          : BT.601 PAL
  Transfer characteristics                 : BT.470 System B, BT.470 System G
  Matrix coefficients                      : BT.601
  
  Audio
  ID                                       : 189 (0xBD)-128 (0x80)
  Format                                   : AC-3
  Format/Info                              : Audio Coding 3
  Mode extension                           : CM (complete main)
  Format settings, Endianness              : Big
  Muxing mode                              : DVD-Video
  Duration                                 : 31mn 36s
  Bit rate mode                            : Constant
  Bit rate                                 : 256 Kbps
  Channel(s)                               : 2 channels
  Channel positions                        : Front: L R
  Sampling rate                            : 48.0 KHz
  Compression mode                         : Lossy
  Stream size                              : 57.9 MiB (4%)
  </code></pre>
  
  <p>I have converted it to mp4 with the following command:</p>
  
  <pre><code>ffmpeg -i input.vob -c:v libx264 -preset slow -crf 19 -c:a aac -b:a 256k -threads 0 output.mp4
  </code></pre>
  
  <p>In the resulting video I see this effect:</p>
  
  <p><a href="https://i.sstatic.net/mh7yr.png" rel="noreferrer"><img src="https://i.sstatic.net/mh7yr.png" alt="img1"></a> <a href="https://i.sstatic.net/WdyOG.png" rel="noreferrer"><img src="https://i.sstatic.net/WdyOG.png" alt="img2"></a> <a href="https://i.sstatic.net/4vOt3.png" rel="noreferrer"><img src="https://i.sstatic.net/4vOt3.png" alt="img3"></a></p>
  
  <p>How can I solve?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-10-08T14:20:29.003Z
Comments.Text: I wrote an app using qTGMC, which gives much better results than yadif https://github.com/hclivess/videer
Comments.UserDisplayName: HCLivess
Tags: <ffmpeg><filter>
Title: How to deinterlacing with ffmpeg?
UserDisplayName: ᴜsᴇʀ
ThreadText: # How to deinterlacing with ffmpeg?
  
  (Asked by: username_0 on 2016-01-14)
  
  I have the following VOB file:
  
  → `ffmpeg -i input.vob` output:
  
  ```
  ffmpeg version N-77455-g4707497 Copyright (c) 2000-2015 the FFmpeg developers
    built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
    configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libdcadec --enable-libfreetype --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
    libavutil      55. 11.100 / 55. 11.100
    libavcodec     57. 20.100 / 57. 20.100
    libavformat    57. 20.100 / 57. 20.100
    libavdevice    57.  0.100 / 57.  0.100
    libavfilter     6. 21.101 /  6. 21.101
    libavresample   3.  0.  0 /  3.  0.  0
    libswscale      4.  0.100 /  4.  0.100
    libswresample   2.  0.101 /  2.  0.101
    libpostproc    54.  0.100 / 54.  0.100
  Input #0, mpeg, from 'input.vob':
    Duration: 00:31:36.96, start: 0.335967, bitrate: 6517 kb/s
      Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bt470bg), 720x576 [SAR 64:45 DAR 16:9], max. 9800 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
      Stream #0:1[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
  
  ```
  
  → `mediainfo input.vob` output:
  
  ```
  General
  Complete name                            : input.vob
  Format                                   : MPEG-PS
  File size                                : 1.44 GiB
  Duration                                 : 31mn 36s
  Overall bit rate mode                    : Variable
  Overall bit rate                         : 6 518 Kbps
  
  Video
  ID                                       : 224 (0xE0)
  Format                                   : MPEG Video
  Format version                           : Version 2
  Format profile                           : Main@Main
  Format settings, BVOP                    : Yes
  Format settings, Matrix                  : Default
  Format settings, GOP                     : M=3, N=12
  Format settings, picture structure       : Frame
  Duration                                 : 31mn 36s
  Bit rate mode                            : Variable
  Bit rate                                 : 6 132 Kbps
  Maximum bit rate                         : 9 800 Kbps
  Width                                    : 720 pixels
  Height                                   : 576 pixels
  Display aspect ratio                     : 16:9
  Frame rate                               : 25.000 fps
  Standard                                 : PAL
  Color space                              : YUV
  Chroma subsampling                       : 4:2:0
  Bit depth                                : 8 bits
  Scan type                                : Interlaced
  Scan order                               : Top Field First
  Compression mode                         : Lossy
  Bits/(Pixel*Frame)                       : 0.591
  Time code of first frame                 : 00:00:00:00
  Time code source                         : Group of pictures header
  Stream size                              : 1.35 GiB (94%)
  Color primaries                          : BT.601 PAL
  Transfer characteristics                 : BT.470 System B, BT.470 System G
  Matrix coefficients                      : BT.601
  
  Audio
  ID                                       : 189 (0xBD)-128 (0x80)
  Format                                   : AC-3
  Format/Info                              : Audio Coding 3
  Mode extension                           : CM (complete main)
  Format settings, Endianness              : Big
  Muxing mode                              : DVD-Video
  Duration                                 : 31mn 36s
  Bit rate mode                            : Constant
  Bit rate                                 : 256 Kbps
  Channel(s)                               : 2 channels
  Channel positions                        : Front: L R
  Sampling rate                            : 48.0 KHz
  Compression mode                         : Lossy
  Stream size                              : 57.9 MiB (4%)
  
  ```
  
  I have converted it to mp4 with the following command:
  
  ```
  ffmpeg -i input.vob -c:v libx264 -preset slow -crf 19 -c:a aac -b:a 256k -threads 0 output.mp4
  
  ```
  
  In the resulting video I see this effect:
  
  [![img1](https://i.sstatic.net/mh7yr.png)](https://i.sstatic.net/mh7yr.png) [![img2](https://i.sstatic.net/WdyOG.png)](https://i.sstatic.net/WdyOG.png) [![img3](https://i.sstatic.net/4vOt3.png)](https://i.sstatic.net/4vOt3.png)
  
  How can I solve?
  
  **Tags:** ffmpeg, filter
  
  > **Comments:**
  > **username_1**: I wrote an app using qTGMC, which gives much better results than yadif https://github.com/username_1/videer  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-01-14. Score: 55 | Accepted answer
  
  Add the yadif filter i.e.
  
  ```
  ffmpeg -i input.vob -vf yadif -c:v libx264 -preset slow -crf 19 -c:a aac -b:a 256k output.mp4
  
  ```
  
  See [yadif docs](https://ffmpeg.org/ffmpeg-filters.html#yadif-1) for more info.
  
  > **Comments:**
  > **username_3**: From empirical comparison I think the bwdif deinterlacing algorithm is superior to yadif, however QTGMC is superior to all of those. If you have to stick with FFmpeg, the nnedi filter is definitely superior [but at the cost of *massive* reduction in processing speed](https://www.reddit.com/r/ffmpeg/comments/d3cwxp/what_is_the_difference_between_bwdif_and_yadif1/). What is your use case, how critical is rendering time and must you stick with FFmpeg or could you branch out into other tools which use FFmpeg along with other things like Vapoursynth?  
  > **username_4**: `-vf yadif_cuda` if you have NVidia and CUDA installed.  
  > **username_5**: To expand on username_3' comment, QTGMC, by default, uses nnedi to deint. What makes QTGMC special is the extra filtering it does before and after nnedi. It also has presets to make it easy to use without fiddling with settings for days. nnedi can be 4x slower or more if you turn off the prescreener--which is not suggested because it gains you little. Otherwise, ffmpeg's default nnedi slowed my overall job by only 25% vs bwdif default. Without QTGMC, nnedi is slightly better than bwdif. With QTGMC, it is massively better. Hybrid makes QTGMC easy: https://forum.videohelp.com/threads/401770  
  
  ---
  
  