Using the C libav APIs I would usually first find the "best" video stream, and then find the "best" related audio stream:
int video_stream_index = av_find_best_stream(format_context, AVMEDIA_TYPE_VIDEO, -1, -1, &video_codec, 0);
int audio_stream_index = av_find_best_stream(format_context, AVMEDIA_TYPE_AUDIO, -1, video_stream_index, &audio_codec, 0);
Example API
StreamContainer.get is pretty overloaded, maybe a new API like StreamContainer.best(type: str, related: Stream | None) -> Stream where type is Stream.type ?
Overview
Add support for
av_find_best_stream
to StreamContainerDesired Behavior
Using the C libav APIs I would usually first find the "best" video stream, and then find the "best" related audio stream:
Example API
StreamContainer.get is pretty overloaded, maybe a new API like
StreamContainer.best(type: str, related: Stream | None) -> Stream
wheretype
is Stream.type ?