<div dir="ltr"><div>Hello,</div><div> </div><div>I want to demux only one stream (e.g. some selected audio stream) from a file which contains video and multiple audio streams. I use standard demuxing procedue: open the file using avformat_open_input and avformat_find_stream_info, then read packets using av_read_frame. But I am interested for packets from only one stream so I am ignoring all packets from remaining streams. However it introduces a big and unnecessary overhead as all streams are processed and e.g. video packets bandwitch is way bigger than audio which I am interested only. How to tell demuxer to process packets for stream which I am interested and do not process others? At this moment I am iterating all AVFormatContext::stream streams and setting discard = AVDISCARD_ALL for streams which I don't want and I see that disk I/O is way lower. The question is: is it right way to do so? Maybe some additional parameters for avformat_open_input can select only one stream in a better way?</div>
<div> </div><div>best regards</div><div> </div><div>Remek</div></div>