diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 0be7b8c718323..041333f178ee8 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -4332,6 +4332,7 @@ Screenshot :webp: WebP :jxl: JPEG XL :avif: AVIF + :bgra: BGRA ``--screenshot-tag-colorspace=`` Tag screenshots with the appropriate colorspace (default: yes). diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst index 0592d9467ee5d..d5123905af3a0 100644 --- a/DOCS/man/vo.rst +++ b/DOCS/man/vo.rst @@ -557,6 +557,8 @@ Available video output drivers are: PNG files. webp WebP files. + bgra + BGRA files. ``--vo-image-png-compression=<0-9>`` PNG compression factor (speed vs. file size tradeoff) (default: 7) diff --git a/video/image_writer.c b/video/image_writer.c index ba1afc4cc3c79..36a34787ec457 100644 --- a/video/image_writer.c +++ b/video/image_writer.c @@ -75,6 +75,7 @@ const struct m_opt_choice_alternatives mp_image_writer_formats[] = { {"jpeg", AV_CODEC_ID_MJPEG}, {"png", AV_CODEC_ID_PNG}, {"webp", AV_CODEC_ID_WEBP}, + {"bgra", AV_CODEC_ID_RAWVIDEO}, #if HAVE_JPEGXL {"jxl", AV_CODEC_ID_JPEGXL}, #endif @@ -706,6 +707,9 @@ bool write_image(struct mp_image *image, const struct image_writer_opts *opts, int alpha = image->fmt.flags & MP_IMGFLAG_ALPHA; destfmt = alpha ? pixfmt2imgfmt(AV_PIX_FMT_YUVA420P) : IMGFMT_420P; } + if (opts->format == AV_CODEC_ID_RAWVIDEO) { + destfmt = IMGFMT_BGRA; + } if (!destfmt) destfmt = get_target_format(&ctx);