Expand description
Conversion helpers from FFmpeg AVFrame / AVPacket to the
mediadecode types parameterized by crate::Ffmpeg and
crate::FfmpegBuffer.
The video-frame conversion is zero-copy: each plane is exposed
as an FfmpegBuffer view into the underlying AVBufferRef, so the
FFmpeg-allocated pixel memory is shared between the source frame
and the produced VideoFrame. Cloning the resulting VideoFrame
bumps refcounts; dropping releases them.
Enums§
- Convert
Error - Errors from
av_frame_to_video_frame.
Functions§
- audio_
frame_ from - Safe wrapper around
av_frame_to_audio_frametaking a borrowedffmpeg::frame::Audio. - av_
frame_ ⚠to_ audio_ frame - Converts an FFmpeg audio
AVFrameinto amediadecode::AudioFrame. - av_
frame_ ⚠to_ video_ frame - Converts an FFmpeg
AVFrame(CPU-side, post-av_hwframe_transfer_dataor from a software decoder) into amediadecode::VideoFrameparameterized bycrate::Ffmpeg/crate::FfmpegBuffer. - av_
subtitle_ ⚠to_ subtitle_ frame - Converts an FFmpeg
AVSubtitleinto amediadecode::SubtitleFrame. - subtitle_
frame_ from - Safe wrapper around
av_subtitle_to_subtitle_frametaking a borrowedffmpeg::Subtitle. - video_
frame_ from - Safe wrapper around
av_frame_to_video_frametaking a borrowedffmpeg::Frame. Recommended entry point for most callers — equivalent to passingframe.as_ptr()to the unsafe variant, but the FFmpeg side keeps the frame alive for the duration of the call so the safety contract is satisfied internally.