[FFmpeg-user] Not able to creating high-quality jpegs/mjpegs

Robert Krüger krueger at lesspain.de
Fri Sep 20 23:24:09 CEST 2013


Hi,

jpeg/mjpeg compression seems to have a certain limit that I am not
able to exceed and that is significantly lower than that of other
graphics programs.

To test I took a png image (a still frame exported from a video) in
1920x1080 and converted it to jpeg like so

ffmpeg -i test.png -c:v mjpeg -q:v 1 test-ffmpeg.jpg

The resulting image has 108k which corresponds to a bitrate of roughly
22 MBit at 25 FPS, which is not much for intra-only.

Compressing the same image using Apple Preview and Gimp at maximum
quality results in an image of approx. 700k, corresponding to a
bitrate of 140 MBit, which is what I want to be able to do with
ffmpeg.

Are there any other command line flags I can use to drive the quality
up? I also tried using -b:v 100M which resulted in an even smaller
file.

full CL and output:

ffmpeg -i test.png -c:v mjpeg -q:v 1 test-ffmpeg.jpg
ffmpeg version N-56463-g20101f4 Copyright (c) 2000-2013 the FFmpeg developers
  built on Sep 19 2013 20:18:44 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration:
  libavutil      52. 44.100 / 52. 44.100
  libavcodec     55. 33.100 / 55. 33.100
  libavformat    55. 18.100 / 55. 18.100
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 86.102 /  3. 86.102
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
Input #0, image2, from 'test.png':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: png, rgba, 1920x1080 [SAR 1:1 DAR 16:9], 25
tbr, 25 tbn, 25 tbc
[swscaler @ 0x7f9eda812200] deprecated pixel format used, make sure
you did set range correctly
Output #0, image2, to 'test-ffmpeg.jpg':
  Metadata:
    encoder         : Lavf55.18.100
    Stream #0:0: Video: mjpeg, yuvj444p, 1920x1080 [SAR 1:1 DAR 16:9],
q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (png -> mjpeg)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
video:106kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.020319%

Thanks,

Robert


More information about the ffmpeg-user mailing list