Search code examples
ffmpegdecodingvideo-playerm3u8http-live-streaming

ffmpeg: Decoding specific AVProgram from the hls stream


I am developing a player based on ffmpeg.

Now I try to decode hls video. The video stream has several programs (AVProgram) separated by quality. I want to select one specific program with desired quality. But ffmpeg reads packets from all programs (all streams).

How can I tell ffmpeg which streams to read?


Solution

  • Solved by using disard field in AVStream structure:

    _stream->discard = AVDISCARD_ALL;