Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support av_find_best_stream #1481

Closed
rectalogic opened this issue Aug 7, 2024 · 1 comment · Fixed by #1490
Closed

Support av_find_best_stream #1481

rectalogic opened this issue Aug 7, 2024 · 1 comment · Fixed by #1490

Comments

@rectalogic
Copy link
Contributor

Overview

Add support for av_find_best_stream to StreamContainer

Desired Behavior

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 ?

@moonsikpark
Copy link
Contributor

makes sense to me

WyattBlue added a commit that referenced this issue Aug 11, 2024
WyattBlue added a commit that referenced this issue Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants