ffmpeg_sidecar::pix_fmt

Function get_bits_per_pixel

Source
pub fn get_bits_per_pixel(pix_fmt: &str) -> Option<u32>
Expand description

Map from the pix_fmt identifier string (e.g. rgb24) to the number of bits per pixel (e.g. 24). Returns None if the pix_fmt is unsupported/unrecognized.

Obtained from ffmpeg -pix-fmts.

ยงExamples

use ffmpeg_sidecar::pix_fmt::get_bits_per_pixel;
assert!(get_bits_per_pixel("rgb24") == Some(24));
assert!(get_bits_per_pixel("asdf") == None);