#[non_exhaustive]pub enum Encoding {
H264,
H265,
Av1,
Vp9,
Vp8,
Theora,
ProRes,
Mpeg4Part2,
MotionJpeg,
Still,
}Expand description
How the pictures inside are compressed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
H264
H.264 / AVC. Patent-pooled, so it is only ever handled by the operating system’s own codec — read through its decoder, and written, by default, through its encoder. Never by one bundled here.
H265
H.265 / HEVC. Identified, and outside vtome’s scope.
Av1
AV1. Royalty-free; read everywhere, and written by the bundled rav1e
wherever the OS has no H.264 encoder, or when asked for.
Vp9
VP9. Royalty-free, and outside vtome’s scope: identified so it can be refused by name.
Vp8
VP8. As VP9.
Theora
Theora. Royalty-free and obsolete; identified, not decoded.
ProRes
Apple ProRes. Intermediate format, not a delivery one.
Mpeg4Part2
MPEG-4 Part 2 (DivX/Xvid).
MotionJpeg
Motion JPEG.
Still
A still image, decoded by the image feature.
Implementations§
Source§impl Encoding
impl Encoding
Sourcepub fn is_royalty_free(self) -> bool
pub fn is_royalty_free(self) -> bool
Whether using this costs a licence fee.
The whole reason this crate exists: anything that answers false here is only ever handled by a codec the operating system already licensed — never one compiled into vtome.
Sourcepub fn is_in_scope(self) -> bool
pub fn is_in_scope(self) -> bool
Whether vtome reads this at all: H.264 and AV1, and stills.
Everything else is identified so it can be refused by name — “outside vtome’s scope” is a different answer from “no decoder compiled in”.
Sourcepub fn is_encodable(self) -> bool
pub fn is_encodable(self) -> bool
Whether vtome can be asked to produce this: H.264, through the OS
encoder and by default, and AV1, through the bundled rav1e.
Narrower than is_royalty_free on one side
— VP9 and Theora are free of charge too, and out of scope — and wider on
the other, because H.264 is written by the operating system’s licensed
encoder rather than by anything here.
Sourcepub fn fourcc(self) -> &'static str
pub fn fourcc(self) -> &'static str
The four-character code this encoding appears as in an MP4 sample entry.
Sourcepub fn from_codec_id(id: &str) -> Option<Self>
pub fn from_codec_id(id: &str) -> Option<Self>
The encoding a codec string names, as MP4 sample entries and Matroska codec IDs spell it.
Case-insensitive, and tolerant of the several spellings each format has
collected — hvc1 and hev1 are both HEVC, V_AV1 and av01 are both
AV1.