[FFmpeg-trac] #10689(avcodec:new): [Android] Provide options to tweak h264_mediacodec encoder encoding quality vs bitrate vs encoding speed
FFmpeg
trac at avcodec.org
Fri Nov 24 14:06:30 EET 2023
#10689: [Android] Provide options to tweak h264_mediacodec encoder encoding quality
vs bitrate vs encoding speed
-------------------------------------+-------------------------------------
Reporter: bubbleguuum | Type:
| enhancement
Status: new | Priority: normal
Component: avcodec | Version:
| unspecified
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
As of FFmpeg v6.1, there is very little that you can do to tweak the video
quality output of the h264_mediacodec encoder vs the bitrate required
(think the equivalent of the libx264 -preset option).
For improving quality, the only way I found is to increase the bitrate
with the -b:v parameter.
When that parameter is specified, the encoder will honor it: it acts as a
max bitrate setting.
The higher the bitrate specified with -b:v, the higher the quality.
In my experience, it requires a quite high bitrate for an acceptable video
quality. For example, for 1080p output, at least 10Mbit is required for
acceptable quality. At 5Mbit, output is very blocky. In that regard, it
seems to operate very much like the libx264 ultrafast or superfast
presets.
It would be great to have more control on quality (vs encoding speed and
bitrate). I'm not super familiar with the MediaCodec encoder API but I
believe there are settings to tweak quality. Although AFAIK, no h264
encoder implementation on Android support constant quality (thus
'-bitrate_mode cq' encoder specific option is not supported) so something
like -crf cannot probably be implemented. Only VBR and CBR are broadly
supported.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10689>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list