pub enum BrowserCodec {
Gif,
Apng,
Webm,
Mp4,
Mp4Hevc,
}Expand description
Browser-friendly animation containers (no ffmpeg).
Variants§
Gif
Animated GIF (feature gif): plays everywhere, 256 colours a frame.
Apng
Animated PNG: full colour and alpha, larger files.
Webm
VP9 in WebM, with alpha when the frames have any.
Mp4
H.264 in an MP4 container (avc1 + avcC). Universally playable.
Transform-coded intra, roughly a hundredth the size of the I_PCM path
this used to take. Mp4Hevc is smaller again where its
narrower playback reach is acceptable.
Mp4Hevc
HEVC in an MP4 container (hvc1 + hvcC), transform-coded.
Two orders of magnitude smaller than Mp4 — 0.16 MB against
47 MB on the 17-frame clip in docs/codec-benchmark.md. The cost is
reach: HEVC in MP4 plays in Safari everywhere and in Chrome/Edge on
hardware that supports it, but not universally the way H.264 does.
Implementations§
Trait Implementations§
Source§impl Clone for BrowserCodec
impl Clone for BrowserCodec
impl Copy for BrowserCodec
Source§impl Debug for BrowserCodec
impl Debug for BrowserCodec
impl Eq for BrowserCodec
Source§impl PartialEq for BrowserCodec
impl PartialEq for BrowserCodec
impl StructuralPartialEq for BrowserCodec
Auto Trait Implementations§
impl Freeze for BrowserCodec
impl RefUnwindSafe for BrowserCodec
impl Send for BrowserCodec
impl Sync for BrowserCodec
impl Unpin for BrowserCodec
impl UnsafeUnpin for BrowserCodec
impl UnwindSafe for BrowserCodec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more