mp4_video

版本 1.0.0 (2.8 KB) 作者: Xiangrui Li
Create mp4 video from Matlab figure
54.0 次下载
更新时间 2021/1/9

Create mp4 video from figure window, like what Matalb VideoWriter does.

mp4_video is a subclass of VideoWriter, with following additional features:

1. The rect feature allows all OS to capture part of the figure, or to exclude UI control if needed.

2. The major benefit is to enable Linux support for mp4 format, using ffmpeg. If ffmpeg is not available, the uncompressed avi file will be kept.

3. Automatically use getframe() or print() to work for Matlab with remote connection.

The usage is shown by this simple example for a moving circle:

h = rectangle('Position', [0 0 1 1], 'Curvature', 1, 'FaceColor', 'k');
axis equal; axis off; xlim([0 10]); ylim([0 10]); % set axis range
vw = mp4_video('movingCircle.mp4', 4); % 4 frames per second
for x = 0:9 % circle location range
h.Position(1:2) = x; % move along diagonal
vw.addFrame(); % add current frame to video buffer
end
vw.save(); % finish the video

引用格式

Xiangrui Li (2024). mp4_video (https://github.com/xiangruili/mp4_video), GitHub. 检索来源 .

MATLAB 版本兼容性
创建方式 R2020a
兼容任何版本
平台兼容性
Windows macOS Linux
标签 添加标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

无法下载基于 GitHub 默认分支的版本

版本 已发布 发行说明
1.0.0

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库