[FFmpeg-devel,3/3] Don't complain about codec2's 700 bit/s modes in ffmpeg.c

Submitted by Tomas Härdin on Dec. 23, 2017, 10:15 p.m.

Details

Message ID 1514067356.4024.3.camel@acc.umu.se
State New
Headers show

Commit Message

Tomas Härdin Dec. 23, 2017, 10:15 p.m.

Comments

Michael Niedermayer Dec. 25, 2017, 7:07 p.m.
On Sat, Dec 23, 2017 at 11:15:56PM +0100, Tomas Härdin wrote:
> 

>  ffmpeg.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 68440596af0b5c26d6123f5ee964414ce9e2f48f  0003-Don-t-complain-about-codec2-s-700-bit-s-modes-in-ffm.patch
> From 8bd1d9981484c9b4964f3fdfd542951a02f5a01d Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= <tjoppen@acc.umu.se>
> Date: Thu, 3 Aug 2017 17:33:04 +0200
> Subject: [PATCH 3/3] Don't complain about codec2's 700 bit/s modes in ffmpeg.c

In absence of a cleaner solution, LGTM

thx

[...]
Tomas Härdin Dec. 26, 2017, 9:03 p.m.
mån 2017-12-25 klockan 20:07 +0100 skrev Michael Niedermayer:
> On Sat, Dec 23, 2017 at 11:15:56PM +0100, Tomas Härdin wrote:
> > 
> >  ffmpeg.c |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 68440596af0b5c26d6123f5ee964414ce9e2f48f  0003-Don-t-complain-
> > about-codec2-s-700-bit-s-modes-in-ffm.patch
> > From 8bd1d9981484c9b4964f3fdfd542951a02f5a01d Mon Sep 17 00:00:00
> > 2001
> > From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= <tjoppen@acc.umu.se>
> > Date: Thu, 3 Aug 2017 17:33:04 +0200
> > Subject: [PATCH 3/3] Don't complain about codec2's 700 bit/s modes
> > in ffmpeg.c
> 
> In absence of a cleaner solution, LGTM

There was a brief discussion last time I think, but a more general
solution is just more complexity until someone provides another example
of a codec that's intended to work at below 1 kbps to justify said
complexity :)
/Tomas

Patch hide | download patch | download mbox

From 8bd1d9981484c9b4964f3fdfd542951a02f5a01d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= <tjoppen@acc.umu.se>
Date: Thu, 3 Aug 2017 17:33:04 +0200
Subject: [PATCH 3/3] Don't complain about codec2's 700 bit/s modes in ffmpeg.c

---
 fftools/ffmpeg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 6aff3366c5..17989a8114 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -3502,7 +3502,8 @@  static int init_output_stream(OutputStream *ost, char *error, int error_len)
             av_buffersink_set_frame_size(ost->filter->filter,
                                             ost->enc_ctx->frame_size);
         assert_avoptions(ost->encoder_opts);
-        if (ost->enc_ctx->bit_rate && ost->enc_ctx->bit_rate < 1000)
+        if (ost->enc_ctx->bit_rate && ost->enc_ctx->bit_rate < 1000 &&
+            ost->enc_ctx->codec_id != AV_CODEC_ID_CODEC2 /* don't complain about 700 bit/s modes */)
             av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too low."
                                          " It takes bits/s as argument, not kbits/s\n");
 
-- 
2.11.0