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
[Feature request] make it easier to detect what a track / codec type is #258
Comments
I agree with this general request.
I was thinking of doing a bit of a clean-up of #[non_exhaustive]
enum TrackType {
Audio,
Video,
Subtitle,
Data, // Maybe
} |
Or, instead of a structural change, simply add a bulk of non-audio codec types? pub(crate) fn codec_id_to_type(track: &TrackElement) -> Option<CodecType> {
// ..
match track.codec_id.as_str() {
"V_AV1" => Some(codecs::CODEC_TYPE_AV1),
// ..
}
} Edit: I'd be willing to simply go through (for example) https://www.matroska.org/technical/codec_specs.html and add the missing codecs. Edit 2: Have a look at this? voidentente@da50d26 |
From what i can tell, there currently is no way to "elegantly" determine what a track (/ codec)'s type is, as in "video", "audio" (others, like "subtitle"), the only workaround i found is comparing
Track::codec_params.codec
withCODEC_TYPE_NULL
which does not seem to elegant.This proposal is to add a helper function to determine the type of a codec (and maybe proxied to
Track
) with signaturefn codec_type(&self) -> CodecType
(whereCodecType
is a enum of types) orfn is_audio_codec(&self) -> bool
.AND/OR a way to determine if a codec of a track is currently supported (not returning
core (codec):unsupported codec
)also in addition maybe a function like
default_track_audio
(similar todefault_track
) but only for returning the first / default audio track. (because in something likewebm
it chooses the first stream, which is a video stream and fails)The text was updated successfully, but these errors were encountered: