[FFmpeg-user] Buffer Size for Stream Copy

Paul B Mahol onemda at gmail.com
Wed Aug 21 01:31:42 CEST 2013

On 8/20/13, Wu-bin Zhen <vvubin at gmail.com> wrote:
> On Fri, Aug 16, 2013 at 3:31 PM, Wu-bin Zhen <vvubin at gmail.com> wrote:
>> Hello ffmpeg,
>> I am using ffmpeg to grab h264 video stream and aac audio stream from an
>> internet based hardware encoder with the codec copy option, and it works
>> pretty well. Now, I start to wonder if I can use the '-bufsize' option
>> for
>> the stream copy, just in case when the network is temporally slow down,
>> or
>> the encoder is suddenly chocking for some reason. I googled a little bit
>> about the 'bufsize' option, and found that most people use the option for
>> encoding.
>> So my question is: Do you think using 'bufsize' option will be helpful
>> for
>> the stream copy? If so, what would be the recommended buffer size? My
>> internet encoder produces video stream with 4000kbits/sec, and audio
>> stream
>> with 128kbits/sec.
>> Thanks, and have a great weekend.
>> -w
> Sorry if I didn't explain clearly. So ffmpeg works fine when I specify the
> option '-bufsize', but later I realized that it actually doesn't care the
> value of the bufsize option. The ffmpeg command below works fine without
> complaining anything about the bufsize value:
>> ffmpeg -i -bufsize helloworld -vcodec
> copy -acodec copy buffer_test.ts
> So I start to wonder if ffmpeg doesn't do anything about '-bufsize' for the
> stream copy.
> Please advise. Thanks

As explainded in documentation and by ffmpeg itself, 'bufsize' is used
for audio/video encoding only.

-bufsize           <int>        E..VA. set ratecontrol buffer size (in
bits) (from INT_MIN to INT_MAX) (default 0

More information about the ffmpeg-user mailing list