[FFmpeg-trac] #1808(undetermined:new): Auto add yadif/format filter when needed

FFmpeg trac at avcodec.org
Fri Oct 12 19:52:28 CEST 2012

#1808: Auto add yadif/format filter when needed
               Reporter:  burek      |                  Owner:
                   Type:             |                 Status:  new
  enhancement                        |              Component:
               Priority:  wish       |  undetermined
                Version:             |               Keywords:
  unspecified                        |               Blocking:
             Blocked By:             |  Analyzed by developer:  0
Reproduced by developer:  0          |
 Summary of the bug:
 A guy on #ffmpeg channel (L) tried to re-encode his media, using:
 ffmpeg -i /media/hd/home-videos/raw/test.avi -crf 18 -c:v libx264 -preset
 veryslow -c:a flac output.mkv
 ffmpeg version 1.0 Copyright (c) 2000-2012 the FFmpeg developers
   built on Sep 29 2012 11:22:50 with gcc 4.7.1 (GCC) 20120721 (prerelease)
   configuration: --prefix=/usr --enable-libmp3lame --enable-libvorbis
 --enable-libxvid --enable-libx264 --enable-libvpx --enable-libtheora
 --enable-libgsm --enable-libspeex --enable-postproc --enable-shared
 --enable-x11grab --enable-libopencore_amrnb --enable-libopencore_amrwb
 --enable-libschroedinger --enable-libopenjpeg --enable-librtmp --enable-
 libpulse --enable-libv4l2 --enable-gpl --enable-version3 --enable-runtime-
 cpudetect --disable-debug --disable-static
   libavutil      51. 73.101 / 51. 73.101
   libavcodec     54. 59.100 / 54. 59.100
   libavformat    54. 29.104 / 54. 29.104
   libavdevice    54.  2.101 / 54.  2.101
   libavfilter     3. 17.100 /  3. 17.100
   libswscale      2.  1.101 /  2.  1.101
   libswresample   0. 15.100 /  0. 15.100
   libpostproc    52.  0.100 / 52.  0.100
 [avi @ 0x1944240] non-interleaved AVI
 [avi @ 0x1944240] Could not find codec parameters for stream 0 (Video:
 none (422P / 0x50323234), 704x464): unknown codec
 Consider increasing the value for the 'analyzeduration' and 'probesize'
 Guessed Channel Layout for  Input Stream #0.1 : stereo
 Input #0, avi, from '/media/hd/home-videos/raw/test.avi':
     encoder         : MEncoder SVN-r35014-4.7.1
   Duration: 01:03:09.55, start: 0.000000, bitrate: 158157 kb/s
     Stream #0:0: Video: none (422P / 0x50323234), 704x464, SAR 59392:59389
 DAR 8192:5399, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc
     Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz,
 stereo, s16, 1536 kb/s
 File 'output.mkv' already exists. Overwrite ? [y/N] Unable to parse option
 value "-1" as pixel format
 Error opening filters!

 After the suggestion to add "-filter:v yadif=1,format=yuv420p" everything
 worked. Here is a log of it:
 <L> in other words, is there a good compressed format viable for archival
 <L> good meaning produces high quality with relatively low size
 <L> mutt
 <L> whoops, that was supposed to be for zsh
 <R> L: yes, I would use ffmpeg -i input -c:v libx264 -preset veryslow -c:a
 flac output.mkv
 <R> er, add -crf 18 after the input
 <R> that will give you highly compressed (lossy) video and lossless audio
 <L> R: darn, i get "Unable to parse option value "-1" as pixel format
 <R> pastie.org your command and all output
 <L> R: http://pastie.org/5045110
 <R> is it interlaced?
 <L> i believe it is
 <L> i didn't not explicitely deinterlace it
 <R> you should, hold on a second
 <R> ffmpeg -i input -filter:v yadif:1,format=yuv420p -c:v libx264 -crf 18
 -c:a flac output.mkv
 <R> L: what is the output fps from the command?
 <L> 29.97
 <L> i get this tho: No such filter: 'yadif:1'
 <R> change it to yadif=1
 <R> that should double the framerate of the input.
 <L> R: getting somewhere now. must figure out how to set ntsc for v4l2
 <L> ah, -standard
 <L> R: damn, that quality is epic.

 So, the question. Can it be implemented in such a way that ffmpeg doesn't
 just say "Could not find codec parameters", but rather to try to
 deinterlace it or something, because I believe a lot of ordinary users
 won't be able to figure out to just add "-filter:v yadif=1,format=yuv420p"
 out of the blue, without any suggestion either from ffmpeg binary or from
 reading the docs (which they never do) :)

Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1808>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list