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

Robert Krüger krueger at lesspain.de
Sun Sep 22 11:50:02 CEST 2013


On Sun, Sep 22, 2013 at 2:03 AM, Paul B Mahol <onemda at gmail.com> wrote:
> On 9/21/13, Robert Krueger <krueger at lesspain.de> wrote:
>> On Fri, Sep 20, 2013 at 11:55 PM, Paul B Mahol <onemda at gmail.com> wrote:
>>> On 9/20/13, Robert Krueger <krueger at lesspain.de> wrote:
>>>> 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
>>>
>>> -q:v 0 ?
>>
>> same result. The files are bit-identical.
>
> -qmin 1 -qmax 1
>
> I forgot this and searched web to learn it again.

That doubled the bitrate. Thanks. ffmpeg rate control is indeed a
mysterious art that only few really understand ;-).

I would like to compare psnr for all these different versions but
somehow I am not doing it right. I could swear that I have used the
psnr filter like this before but now I can't get it to work.

I first converted the files (original and compressed versions) into
ffv1 with yuv444p pixel format, so the pixel formats match for psnr
comparison and are supported by the psnr filter. Then I used the
command line below and got no psnr output (stats.log is empty as
well). I have used this command line with other files before and it
worked (I may overlook something, of course), so I am guessing now,
what I am doing wrong. I cannot see any error message either.

ffmpeg -i test-ffmpeg-g5-ffv1.mkv -vf "movie=test-ffv1.mkv,
setpts=PTS-STARTPTS [main]; [main][ref] psnr="stats_file=stats.log"
[out]" -f null /dev/null
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, matroska,webm, from 'test-ffmpeg-g5-ffv1.mkv':
  Metadata:
    ENCODER         : Lavf55.18.100
  Duration: 00:00:00.04, start: 0.000000, bitrate: 52926 kb/s
    Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv444p, 1920x1080,
SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
Output #0, null, to '/dev/null':
  Metadata:
    encoder         : Lavf55.18.100
    Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p,
1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 25 tbc
(default)
Stream mapping:
  Stream #0:0 -> #0:0 (ffv1 -> rawvideo)
Press [q] to stop, [?] for help
[null @ 0x7fe30381a000] Encoder did not produce proper pts, making some up.
frame=    1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead -122.916667%

Any ideas, what I am doing wrong here?


More information about the ffmpeg-user mailing list