[Libav-user] AVStream.discard vs av_open_input_stream()
Brian Fallik
bfallik at bamboom.com
Tue Aug 16 15:38:17 CEST 2011
Hi,
I have some code that uses libav* to read in mpeg-ts data and discard
certain streams based on their PID. To discard I set:
input_context->streams[i]->discard = AVDISCARD_ALL;
and then loop over the packets with
av_read_frame()/av_interleaved_write_frame().
This works perfectly fine when I use av_open_input_file() to access
the data from a file on disk. However, when I switch to using
av_open_input_stream(), av_read_frame() incorrectly returns the
packets for the discarded stream.
Anyone have any hints or thoughts on how I can fix this? Am I doing
something wrong or is this a bug in ffmpeg? I'd expect
av_open_input_stream() and av_open_input_file() to behave similarly
when operating on the same data. The only difference is whether
ffmpeg reads from the file or from memory.
brian
More information about the Libav-user
mailing list