openPacketReader

Opens the low-level demux cursor for exactly streams. The returned reader owns the source's cursor until it is closed; no batch decode or source-level seek may run concurrently.

Opens the low-level demux cursor for exactly streams. The returned reader owns the source's cursor until it is closed; no batch decode or source-level seek may run concurrently.

Opens a reader that hands out owned packets, one at a time, under your control.

This is the demuxing half of a player. The batch API fuses demuxing and decoding, which is right for transcoding and wrong for playback: a player needs audio and video to decode independently, so a slow video decoder cannot stop the audio clock, and it needs to seek while all of that runs.

Streams outside streams are marked for the demuxer to discard, so their packets are skipped inside libavformat instead of being read and thrown away here. On a file with ten audio tracks that is most of the read work. Closing the reader puts every stream back, so a later reader or decode pass over a stream this one skipped still sees its packets.

One reader at a time, and it excludes the batch decode API for as long as it is open. Close it when done.

Opens the low-level demux cursor for exactly streams. The returned reader owns the source's cursor until it is closed; no batch decode or source-level seek may run concurrently.

Opens the low-level demux cursor for exactly streams. The returned reader owns the source's cursor until it is closed; no batch decode or source-level seek may run concurrently.