[Libav-user] Reading from a stream
J Decker
d3ck0r at gmail.com
Fri Apr 18 19:03:19 CEST 2014
On Fri, Apr 18, 2014 at 12:56 AM, J Decker <d3ck0r at gmail.com> wrote:
> I'm attempting to use custom IO. I have successfully used it to remap
> fopen, fread, fseek etc. I have mostly successfully done the same for this
> network stream...
>
> Question is... It looks like if I supply no seek routine, the custom IO
> should set a characteristics sort of flag indicating no seek... but without
> the seek it fails to read the stream; is there a suggested codec/container
> format to use that doesn't seek to the end or near the end first?
>
> Also, it is given that I should
> avio_alloc_context
> foramt_alloc_context
> (do something to start opening the file)
>
> use some of the file and call av_probe_input_format... and
> finally avformat_open_input with a blank filename....
>
> I notice that open_input with a filename must not do this same step...
> because, with this sample movie I have, with the probe, the open_input
> seeks to read the last 8 bytes and then fails indicating a bad format. If
> I bypass the probe, or pass it a 0 size, then the avformat_open_input is
> able to read, but it seeks to the end minus 18k(something) and reads to
> the end in 2k blocks... and I'm subsequently able to get audio and sound
> streams to play... but not if I call the probe_infput_format first...
>
> I'm not sure what the return of the original probe is; but it's 0 when the
> video loads.
>
>
I checked this morning, probe results with a QuickTime/MOV format... which
is also the same format as open_input finds; but the resulting read
behavior is totally different
> I see that the command line tool is supposed to support pipes (at least on
> some platforms), so I assume it does a similar thing to build a IO context
> that doesnt' have seek?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20140418/180c43a3/attachment.html>
More information about the Libav-user
mailing list