[FFmpeg-devel] [PATCH 2/7] avcodec/ffv1enc: add information message when version is changed by the encoder

Michael Niedermayer michael at niedermayer.cc
Thu Mar 8 02:33:26 EET 2018


On Wed, Mar 07, 2018 at 04:49:24PM +0100, Jerome Martinez wrote:
> There is a message when coder type is forced to a value not chosen by user,
> but no message when version is forced to a value not chosen by user.
> This patch adds such message for more coherency in the messages, and the
> user is informed that the command is not fully respected.
> 
> ffmpeg f lavfi -i mandelbrot=s=1920x1080 -vf format=gbrp9 -vframes 1 -c ffv1
> -level 0 -coder 0 a.mkv
> 
> Before:
> [ffv1 @ 000002492CD69B40] bits_per_raw_sample > 8, forcing range coder
> 
> After:
> [ffv1 @ 000001A6E404A780] bits_per_raw_sample > 8, forcing version 1
> [ffv1 @ 000001A6E404A780] bits_per_raw_sample > 8, forcing range coder
> 
> 

>  ffv1enc.c |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> cb1df919e21fe4d388df7de9349c5c2c46777862  0002-avcodec-ffv1enc-add-information-message-when-version.patch
> From 49db6049fa50976683fc651cf180ab8c7428225e Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= <jerome at mediaarea.net>
> Date: Wed, 7 Mar 2018 10:37:46 +0100
> Subject: [PATCH 2/7] avcodec/ffv1enc: add information message when version is
>  changed by the encoder
> 
> ---
>  libavcodec/ffv1enc.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
> index d71d952c6d..ac8b715b74 100644
> --- a/libavcodec/ffv1enc.c
> +++ b/libavcodec/ffv1enc.c
> @@ -509,7 +509,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
>  {
>      FFV1Context *s = avctx->priv_data;
>      const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
> -    int i, j, k, m, ret;
> +    int i, j, k, m, ret, oldversion;
>  
>      if ((ret = ff_ffv1_common_init(avctx)) < 0)
>          return ret;
> @@ -534,6 +534,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
>          }
>          s->version = avctx->level;
>      }
> +    oldversion = s->version;
>  
>      if (s->ec < 0) {
>          s->ec = (s->version >= 3);
> @@ -679,6 +680,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
>      av_assert0(s->bits_per_raw_sample >= 8);
>  
>      if (s->bits_per_raw_sample > 8) {
> +        if (oldversion >= 0 && oldversion != s->version) {
> +            av_log(avctx, AV_LOG_INFO,
> +                    "bits_per_raw_sample > 8, forcing version 1\n");
> +            oldversion = s->version;
> +        }

I dont think this works consistently

The code does not seem to be limited to the case where the user has
specifified a version for example unless i miss something


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

You can kill me, but you cannot change the truth.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180308/96751ece/attachment.sig>


More information about the ffmpeg-devel mailing list