FFmpeg 的 MoonBit 封装:音视频解码/转码/封装的进程内绑定,链接系统 ffmpeg 开发包,为 yue-media 提供媒体解码层
// 打开(width/height 为输出帧目标尺寸,0 = 源尺寸)
let d = @ffmpeg.Demuxer::open("demo.avi")? // AVI/MP4/MKV/WebM…
d.stream_width() // 视频流原生宽
d.stream_height() // 视频流原生高
d.duration_s() // 时长秒(容器未知时 0)
// 逐帧解码(RGBA 字节,恰好 w*h*4;流结束 None)
while let Some(frame) = d.decode_rgba() { ... }
d.seek(1.5)? // 时间戳 seek(avformat_seek_file + 解码器 flush)
d.close() // 释放(之后不可再用)Install
Download zipFFmpeg 的 MoonBit 封装:音视频解码/转码/封装的进程内绑定,链接系统 ffmpeg 开发包,为 yue-media 提供媒体解码层