[FFmpeg-trac] #3150(avcodec:open): H.261 encoding: "-cmp rd" ruins image quality

FFmpeg trac at avcodec.org
Tue Mar 25 12:58:26 CET 2014

#3150: H.261 encoding: "-cmp rd" ruins image quality
             Reporter:  maikmerten  |                    Owner:
                 Type:  defect      |                   Status:  open
             Priority:  normal      |                Component:  avcodec
              Version:  git-master  |               Resolution:
             Keywords:  h261        |               Blocked By:
             Blocking:              |  Reproduced by developer:  1
Analyzed by developer:  0           |

Comment (by cehoyos):

 I tested the following:
 $ ffmpeg -f lavfi -i testsrc=s=352x288 -vb 256k -t 60 -cmp sad outsad.h261
 This encodes at 302.5kbits/s and the output file looks visually not great
 but acceptable (some artefacts are visible after 20 seconds, I originally
 thought that they were related to the codec and the bitrate.
 I then tried:
 $ ffmpeg -f lavfi -i testsrc=s=352x288 -vb 256k -t 60 -cmp rd outrd.h261
 The output file outrd,h261 is encoded with 422.0kbits/s and looks visually
 significantly worse than outsad.h261 (starting from 20 seconds on,
 outsad.h261 also gets worse after 20 seconds, but still looks much better
 than outrd.h261).
 {{{-cmp sse}}} produces an even larger file with similar artefacts as
 outrd.h261 but they start earlier.

 If I encode only ten seconds, file size is similar for all three cmp modes
 (sad: 424.5kbits/s, rd: 414.8kbits/s, sse; 426.2kbits/s) and all three
 output files do not show obvious artefacts. If I should guess, I'd say
 there is a bug (that worsens h261 quality significantly after some
 encoding time) and some cmp modes make this bug much more visible than
 others (and the default sad).

 The issue that {{{-cmp 1}}} produces larger files with significantly more
 artefacts than {{{-cmp 0}}} is not a regression, I can reproduce it with

Ticket URL: <https://trac.ffmpeg.org/ticket/3150#comment:5>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list