[Libav-user] Help about custom I/O context

Massimo Battistel battistel at gmail.com
Mon Dec 23 16:55:52 CET 2013


Hello,
I have to read an ASF stream from a named pipe (on windows).
The pipe is already opened and I cannot seek.

I've followed these links to begin (I think there is no official doc about
the argument):
http://www.codeproject.com/Tips/489450/Creating-Custom-FFmpeg-IO-Context
http://cdry.wordpress.com/2009/09/09/using-custom-io-callbacks-with-ffmpeg/

I've found some diffs with official doc:

1.
If my buf size is (1000 + FF_INPUT_BUFFER_PADDING_SIZE), When calling
"avio_alloc_context" the 2nd params buffer_size must be 1000 or (1000 +
FF_INPUT_BUFFER_PADDING_SIZE)?

2.
Does it make the difference specify AVFormatContecxt->flags =
AVFMT_FLAG_CUSTOM_IO?

3.
How to allocate the buffer? av_malloc(1000) or new BYTE[1000]?

4.
The articles say that it is mandatory to use AVProbeData and
av_probe_input_format to avoid application crashes, but I have no probs
with normal flow using avformat_open_input and avformat_find_stream_info.
Is this safe?

5.
a. does avformat_open_input reads header only?
b. is avformat_find_stream_info the method that uses analyzeduration and
probesize values?

Do you have some resource about this subject to provide?

thanks a lot,
MB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20131223/213cb388/attachment.html>


More information about the Libav-user mailing list