From ee0f4444f9b7e22e6b2b3895bf340f585b0cce70 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 2 Aug 2019 16:04:54 +0200 Subject: image_writer: add webp-compression option --- video/image_writer.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'video/image_writer.c') diff --git a/video/image_writer.c b/video/image_writer.c index 29cdac10c1..e66543a772 100644 --- a/video/image_writer.c +++ b/video/image_writer.c @@ -50,6 +50,7 @@ const struct image_writer_opts image_writer_opts_defaults = { .jpeg_source_chroma = 1, .webp_lossless = 0, .webp_quality = 75, + .webp_compression = 4, .tag_csp = 0, }; @@ -71,6 +72,7 @@ const struct m_option image_writer_opts[] = { OPT_INTRANGE("png-filter", png_filter, 0, 0, 5), OPT_FLAG("webp-lossless", webp_lossless, 0), OPT_INTRANGE("webp-quality", webp_quality, 0, 0, 100), + OPT_INTRANGE("webp-compression", webp_compression, 0, 0, 6), OPT_FLAG("high-bit-depth", high_bit_depth, 0), OPT_FLAG("tag-colorspace", tag_csp, 0), {0}, @@ -135,6 +137,7 @@ static bool write_lavc(struct image_writer_ctx *ctx, mp_image_t *image, FILE *fp av_opt_set_int(avctx, "pred", ctx->opts->png_filter, AV_OPT_SEARCH_CHILDREN); } else if (codec->id == AV_CODEC_ID_WEBP) { + avctx->compression_level = ctx->opts->webp_compression; av_opt_set_int(avctx, "lossless", ctx->opts->webp_lossless, AV_OPT_SEARCH_CHILDREN); av_opt_set_int(avctx, "quality", ctx->opts->webp_quality, -- cgit v1.2.3