image_writer: use common format selection for AVIF screenshots

--screenshot-avif-pixfmt no longer defaults to yuv420p.
This commit is contained in:
Kacper Michajłow 2023-12-03 18:25:09 +01:00 committed by sfan5
parent 8884902d8b
commit 4949cab734
3 changed files with 5 additions and 5 deletions

View File

@ -31,6 +31,7 @@ Interface changes
- add `--secondary-sub-delay`, decouple secondary subtitles from
`--sub-delay`
- add the `--osd-bar-border-size` option
- `--screenshot-avif-pixfmt` no longer defaults to yuv420p
--- mpv 0.37.0 ---
- `--save-position-on-quit` and its associated commands now store state files
in %LOCALAPPDATA% instead of %APPDATA% directory by default on Windows.

View File

@ -4559,9 +4559,8 @@ Screenshot
Default: ``libaom-av1``
``--screenshot-avif-pixfmt=<format>``
Specify the pixel format to the libavcodec encoder.
Default: ``yuv420p``
Specify the pixel format for the libavcodec encoder. Defaults to empty,
which lets mpv pick one close to the source format.
``--screenshot-avif-opts=key1=value1,key2=value2,...``
Specifies libavcodec options for selected encoder. For more information,

View File

@ -59,7 +59,6 @@ const struct image_writer_opts image_writer_opts_defaults = {
.jxl_distance = 1.0,
.jxl_effort = 4,
.avif_encoder = "libaom-av1",
.avif_pixfmt = "yuv420p",
.avif_opts = (char*[]){
"usage", "allintra",
"crf", "32",
@ -717,7 +716,8 @@ bool write_image(struct mp_image *image, const struct image_writer_opts *opts,
#if HAVE_AVIF_MUXER
if (opts->format == AV_CODEC_ID_AV1) {
write = write_avif;
destfmt = mp_imgfmt_from_name(bstr0(opts->avif_pixfmt));
if (opts->avif_pixfmt && opts->avif_pixfmt[0])
destfmt = mp_imgfmt_from_name(bstr0(opts->avif_pixfmt));
}
#endif
if (opts->format == AV_CODEC_ID_WEBP && !opts->webp_lossless) {