pub enum Target {
Mp3,
Opus,
Aac,
Vorbis,
Flac,
Wav,
}Expand description
A format a copy can be converted into.
Deliberately short. Every entry here is a format a portable player is likely to want, and each one costs a decoder somebody has to have: adding a target nobody asked for is a promise to keep it working.
Variants§
Mp3
The one every device plays.
Opus
Best quality per byte at low bitrates, and what a modern player wants.
Aac
What Apple devices prefer, in an MP4 container.
Vorbis
The free lossy format Ogg carries.
Flac
Lossless, and much smaller than WAV: the reason to convert a WAV rip.
Wav
Uncompressed, for a device that plays nothing else.
Implementations§
Source§impl Target
impl Target
Sourcepub fn parse(word: &str) -> Option<Target>
pub fn parse(word: &str) -> Option<Target>
The target a typed word names, or None for a word that names none.
Sourcepub fn lossy_names() -> String
pub fn lossy_names() -> String
The targets that have a quality setting at all.
Read from the same table as everything else, so a format added tomorrow appears here without anybody remembering to add it — which is the whole reason the table exists.
Sourcepub fn quality_forms(self) -> &'static str
pub fn quality_forms(self) -> &'static str
Accepted quality settings for this encoder, for actionable refusals.
Sourcepub fn extension(self) -> &'static str
pub fn extension(self) -> &'static str
The file extension a converted file carries, without its dot.
Sourcepub fn keeps_embedded_art(self) -> bool
pub fn keeps_embedded_art(self) -> bool
Whether a cover embedded in the source can travel into this target at
all. false here is not this code declining to carry it — ffmpeg
itself refuses to mux a picture stream into wav, opus or vorbis
(verified directly: mapping a video stream into any of the three fails
outright and produces no file), so the loss happens at the encoder
whatever is asked of it. convert reads this same rule, once.
Canonical tag keys present holds that this target is known to drop.
Empty for every target but wav, and empty for wav too when nothing
present falls outside its vocabulary — a file tagged with only title,
artist and album loses nothing by becoming a WAV.