[FFmpeg-user] Buffer Size for Stream Copy

Paul B Mahol onemda at gmail.com
Tue Aug 27 23:39:56 CEST 2013


On 8/27/13, Wu-bin Zhen <vvubin at gmail.com> wrote:
> On Tue, Aug 20, 2013 at 7:31 PM, Paul B Mahol <onemda at gmail.com> wrote:
>
>> 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 http://192.168.1.224:1881/stream.ts -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
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>
> Thanks for your clear explanation, so I can forget about this option for
> copy streams. By the way, do you think is there a way to set buffer for the
> stream copy? For my case the copy is based on the network, not from the
> local hardware, so I am worry when the network or the encoder is temporally
> inaccessible.

I do not completly understand problem you want to solve.

>
> I will appreciate if you would advise any method to make the stream copy
> more stable.

If something is not stable then perhaps you should report bug.


More information about the ffmpeg-user mailing list