[FFmpeg-user] Setting 'crf' option when converting with ffmpeg

Andrei Petru Mura mapandrei at gmail.com
Tue Dec 17 07:51:15 CET 2013


I have a H264 encoded file that I try to convert to a mjpeg format.
That's the command that I issue and its output:

*/home/netnfork/bin/ffmpeg -i ./Event20131026000020003.avi -crf 12 -c:v
mjpeg -vf hflip ./out.avi*
*ffmpeg version git-2013-10-15-c35d29a Copyright (c) 2000-2013 the FFmpeg
developers*
*  built on Oct 15 2013 11:56:38 with gcc 4.4.7 (GCC) 20120313 (Red Hat
4.4.7-3)*
*  configuration: --prefix=/home/netnfork/ffmpeg_build
--extra-cflags=-I/home/netnfork/ffmpeg_build/include
--extra-ldflags=-L/home/netnfork/ffmpeg_build/lib
--bindir=/home/netnfork/bin --extra-libs=-ldl --enable-gpl --enable-nonfree
--enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-libfreetype --enable-libspeex
--enable-libtheora*
  libavutil      52. 46.101 / 52. 46.101
  libavcodec     55. 36.100 / 55. 36.100
  libavformat    55. 19.102 / 55. 19.102
  libavdevice    55.  4.100 / 55.  4.100
  libavfilter     3. 88.101 /  3. 88.101
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
[avi @ 0xb710e20] probed stream 1 failed
[avi @ 0xb710e20] Stream #2: not enough frames to estimate rate; consider
increasing probesize
[avi @ 0xb710e20] Could not find codec parameters for stream 1 (Subtitle:
none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize'
options
[avi @ 0xb710e20] Could not find codec parameters for stream 2 (Subtitle:
none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize'
options
*Input #0, avi, from './Event20131026000020003.avi':*
*  Duration: 00:00:43.67, start: 0.000000, bitrate: 8034 kb/s*
*    Stream #0:0: Video: h264 (High) (X264 / 0x34363258), yuvj420p(pc),
1920x1080, 30 fps, 30 tbr, 30 tbn, 30 tbc*
*    Stream #0:1: Subtitle: none*
*    Stream #0:2: Subtitle: none*
*Codec AVOption crf (Select the quality for constant quality mode)
specified for output file #0 (./out.avi) has not been used for any stream.
The most likely reason is either wrong type (e.g. a video option with no
video streams) or that it is a private option of some encoder which was not
actually used for any stream.*
*File './out.avi' already exists. Overwrite ?* [y/N] y
Output #0, avi, to './out.avi':
  Metadata:
    ISFT            : Lavf55.19.102
    Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj420p, 1920x1080,
q=2-31, 200 kb/s, 30 tbn, 30 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mjpeg)
Press [q] to stop, [?] for help
frame=  260 fps=110 q=0.0 Lsize=   24737kB time=00:00:08.66
bitrate=23382.6kbits/s
video:24726kB audio:0kB subtit ...

The red written text is the problem that I don't know how to deal with. Can
anybody tell me how to deal with this problem? I want to specify the "crf"
for this conversion because the quality resulted is very bad in a few
specific files. Why does "crf" does not take effect when I specify it in my
scenario?


More information about the ffmpeg-user mailing list