3 releases (breaking)
0.2.0 | Dec 18, 2023 |
---|---|
0.1.1 | Nov 29, 2020 |
0.1.0 |
|
0.0.0 | Oct 11, 2020 |
#149 in Video
701 downloads per month
Used in 2 crates
(via mediasoup)
28KB
563 lines
h264-profile-level-id
Idiomatic Rust port of https://github.com/ibc/h264-profile-level-id by Iñaki Baz Castillo.
Rust utility to process H264 profile-level-id
values based on Google's libwebrtc C++ code.
Basic usage example:
use h264_profile_level_id::{Profile, Level, ProfileLevelId};
fn main () {
let profile_level_id: ProfileLevelId = "42e01f".parse().unwrap();
assert_eq!(profile_level_id.profile(), Profile::ConstrainedBaseline);
assert_eq!(profile_level_id.level(), Level::Level31);
let s = profile_level_id.to_string();
assert_eq!(s.as_str(), "42e01f");
let local_profile_level_id = "42e01f".parse::<ProfileLevelId>().ok();
let local_level_asymmetry_allowed = true;
let remote_profile_level_id = "42e015".parse::<ProfileLevelId>().ok();
let remote_level_asymmetry_allowed = true;
assert_eq!(
h264_profile_level_id::generate_profile_level_id_for_answer(
local_profile_level_id,
local_level_asymmetry_allowed,
remote_profile_level_id,
remote_level_asymmetry_allowed
),
Ok("42e01f".parse::<ProfileLevelId>().unwrap()),
);
}
Contribution
Feel free to create issues and send pull requests, they are highly appreciated!
License
ISC
Dependencies
~280–780KB
~18K SLoC