[FFmpeg-devel] [PATCH]Higher default mpeg muxrate for large dimensions

Michael Niedermayer michaelni at gmx.at
Wed Jan 18 01:55:22 CET 2012


On Wed, Jan 18, 2012 at 12:16:52AM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> I don't know what negative effects attached patch may have, but it is 
> currently not possible to specify a -bufsize for constant (low) quantiser - 
> specifying a bufsize automatically increases the quantiser to max - and for 
> high resolution, the current default bufsize is too low.
> See "mpeg2 bufsize question" on -user.
> 
> Please comment, Carl Eugen

>  mpegenc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> e35e5f118962cbe2f7f03c153dae61c5a4d90449  patchmuxrate.diff
> diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
> index dce1786..f3bae32 100644
> --- a/libavformat/mpegenc.c
> +++ b/libavformat/mpegenc.c
> @@ -374,7 +374,7 @@ static int mpeg_mux_init(AVFormatContext *ctx)
>                  stream->max_buffer_size = 6*1024 + st->codec->rc_buffer_size/8;
>              else {
>                  av_log(ctx, AV_LOG_WARNING, "VBV buffer size not set, muxing may fail\n");
> -                stream->max_buffer_size = 230*1024; //FIXME this is probably too small as default
> +                stream->max_buffer_size = FFMAX(st->codec->width * st->codec->height, 230*1024);

iam not sure about this, its a bit hackish but probably ok as long as
the standard resolutions never result in too large buffers

also the max buffer size that can be stored in the file should not be
exceeded

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120118/2273d8f9/attachment.asc>


More information about the ffmpeg-devel mailing list