[FFmpeg-devel] [RFC] ac3enc: how do I force ac3 encoder tooutput frames with the same size?

Piotr Bandurski ami_stuff at o2.pl
Tue Dec 25 15:09:34 CET 2012


Hi,

> one way is to use a bitrate that produces an integer size
> (like 65536) and apply
> 
> diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
> index de8defc..b4acea2 100644
> --- a/libavcodec/ac3enc.c
> +++ b/libavcodec/ac3enc.c
> @@ -2210,7 +2210,7 @@ static av_cold int validate_options(AC3EncodeContext *s)
>              if (!best_diff)
>                  break;
>          }
> -        avctx->bit_rate    = best_br;
> +//         avctx->bit_rate    = best_br;
>          s->frame_size_code = best_code << 1;
>          s->frame_size_min  = 2 * ff_ac3_frame_size_tab[s->frame_size_code][s->bit_alloc.sr_code];
>          s->num_blks_code   = 0x3;
> 
> 
> [...]

When I use "-ar 11025 -ac 1 -ab 16384 out.rm" then the first frame is 278 and the rest of the
frames are 280 (RealPlayer plays "silence"). Is there a way to get all of the frames with 278?

Regards



More information about the ffmpeg-devel mailing list