image thumbnail

FFmpeg Toolbox

version 2.2.1.1 (181 KB) by Kesh Ikuma
一组包装器函数以直接从MATLAB运行ffmpeg

6.3K Downloads

Updated2018年7月13日

查看许可证

FFmpeg (http://ffmpeg.org/)是一个完整的跨平台解决方案,用于记录,转换和流音频和视频。FFMPEG工具箱旨在为Matlab带来FFMPEG功能。虽然FFMPEG支持大量的金宝app多媒体格式和编解码器,但FFMPEG工具箱带来了与其输出选项参数更接近用户的选定的少数(MP3,AAC,MPEG4,X264,Animated GIF)。
INSTALLATION
To use this toolbox, FFmpeg binaries must already be downloaded and made available on the PC. (E.g., in Windows, ffmpeg.exe must be available). In MATLAB, run the toolbox setup m-file (ffmpegsetup.m) and follow its instructions. Note that if a newer version of FFmpeg is placed elsewhere on the PC, you must rerun ffmpegsetup to specify which ffmpeg executable is used with the toolbox.
示例1.使用AAC音频编解码器和X264视频编解码器将AVI电影文件转换为MP4:
ffmpegtranscode.('input.avi', 'output.mp4', 'AudioCodec', 'aac', 'VideoCodec', 'x264');

示例2.要创建运行的正文的动画GIF:

t = linspace(0,1,1001);
phi = linspace(0,2 * pi,21);
figure;
for n = 1:numel(phi)
绘图(T,SIN(2 * PI * T + PHI(N)))
打印(' - dpng',sprintf('test%02d.png',n));%创建一个中间PNG文件
结尾
ffmpegimages2video('test%02d.png','sinedemo.gif','InputFrameRate',5,...
'VideoCodec','gif','DeleteSource','on');

示例3:将透明掩码叠加到视频

VideoFile ='Video.mp4';
maskfile ='mask.png';与Video.mp4帧相同的大小
filtgraph = [ffmpegfilter.head ffmpegfilter.overlay ffmpegfilter.tail];
filtgraph (1) . link (filtgraph (2), 0: v);% video.mp4as the main
filtgraph(1).link(filtgraph(2),'1:v',true); % mask.png as overlayed
filtgraph(2).link(filtgraph(3));
ffmpegcombine({'VideoFile.mp4'''MaskFile'},'Output.mp4',FileTraph);

TOOLBOX FUNCTION AND CLASS LIST:

工具箱设置
ffmpegsetup.- Run this first to use this toolbox

FFMPEG功能列表功能
ffmpegcodecs - Gets supported video codecs
ffmpegcolor.- Convert color expression from MATLAB to FFmpeg
ffmpegcolors - 获取ffmpeg颜色名称及其RGB值
ffmpegformats - 获取多媒体文件格式
ffmpegpixfmts - 得到支持金宝app的视频像素格式

FFmpeg wrapper functions
ffmpegextract - Extract a stream from a media file
ffmpegimage2video - Create video file from a series of images
ffmpeginfo.- Retrieves media file information
ffmpegtranscode - 转码介质文件(支持裁剪和缩放)金宝app
ffmpegcomebin.- Marge multiple media files with a filtergraph

FFMPEG过滤器发生器功能
ffmpegfiltersvideotform - 应用一系列空间变换
ffmpegfilterspalette - 生成和应用256色调

FFmpeg filters (ffmpegfilter package)
ffmpegfilter.crop - 裁剪视频
ffmpegfilter.hflip - Flip video horizontally
ffmpegfilter.histeq - Apply global color histogram equalization
ffmpegfilter.null - 通过
ffmpegfilter.overlay - 覆盖另一个视频
ffmpegfilter.pad - 垫视频
ffmpegfilter.palettegen - Generate a 256-color palette for a video
ffmpegfilter.paletteuse - Use a palette to reduce colors in video
ffmpegfilter.rotate - 旋转视频
ffmpegfilter.scale - 秤或调整视频大小
ffmpegfilter.setdar - Change display-aspect-ratio (DAR) setting
ffmpegfilter.setsar - 更改样本纵横比(SAR)设置
ffmpegfilter.split - Split into several identical outputs
ffmpegfilter.Transpose - 使用列转换视频行
ffmpegfilter.vlip - 垂直翻转视频

ffmpegfilter.head - 滤波器的开始(每个滤波器1个)
ffmpegfilter.tail - End of filtergraph (one per filtergraph)
ffmpegfilter.base - 所有ffmpegfilter类的基类

低级FFMPEG包装器功能
ffmpegexec.args - Run FFmpeg with custom option structs
ffmpegexec.- Run FFmpeg with custom argument string

引用

kesh ikuma(2021)。FFmpeg Toolbox(//www.tatmou.com/matlabcentral/fileexchange/42296-ffmpeg-toolbox), MATLAB Central File Exchange. Retrieved

马铃薯草Release Compatibility
用R2013A创建
Compatible with any release
平台兼容性
Windows macOS Linux.

社区Treasure Hunt

找到Matlab Central中的宝藏,并发现社区如何帮助您!

Start Hunting!