【源码】FFmpegGUI:转换、修剪、裁剪、缩放、合并视频等

【源码】FFmpegGUI:转换、修剪、裁剪、缩放、合并视频等_第1张图片

FFmpegGUI能够在没有任何Matlab工具箱的情况下转换视频。一般来说,ffmpeg比Matlab工具箱快得多。

FFmpegGUI converts videos without any Matlab toolbox. In general ffmpeg is much faster than Matlab toolboxes.

主要特点

•修剪播放时间(开始和结束时间)

•裁剪面积

•缩放(调整)区域、拉伸或填充

•更改帧速率

•设定质量

•设置压缩率

•如果可能,使用默认编码器(主要是h264)或h265

此外:

•将图像转换为视频

•将视频分解为图像

•在视频上叠加图像

•最多可合并三个视频

Features

• Trim play time (start and end time)

• Crop area

• Scale (resize) area, stretch or pad

• Change frame rate

• Set quality

• Set compression

• Use default encoder (mostly h264) or high encoder h265 if possible

In addition:

• Convert images to video

• Decompose video to images

• Overlay an image on a video

• Merge up to three video

Since ffmpeg offers a tremendous choice of parameters, in most cases the default parameters are used, in order to make videos compatible with most players.

Remarks:

Speed

The ffmpeg commands are not in all cases optimized for process speed. E.g. if you merge 3 parts of the same video the reencoding part can be replaced with a copy command. Here, the ffmeg documentation is incomplete on what parameters must be equal for a copy procedure.

Output folder

The output folder is always ‘…/ffmpegGUI/Output’.

Codecs

The selection of codecs is minimal, since every video format (about 50) has its own codecs. Therefore in general only the default codec is used.

Progress bar

In Matlab a ‘system’ or a ‘dos’ command blocks entirely Matlab. Even timer interrupts are not fired. In order to display a ffmpeg progress bar a work around with an extra windows-command-window is implemented.

The progress bar is accurate, while the predicted remaining time is an estimate. So far, it is in a beta stage.

Main reason: DOS doesn’t accept special characters like ‘äöü’.

Width, height

The width and height are forced to even numbers, since some pixel-formats, as the default in h264, require this.

Embedded VLC

The single step functions (e.g. +1) is only accurate if the video has many key frames. Else it deviates by ±2 frames. Towards the end of a video, single step is not available with VLC.

A click on the time bar moves the play time.

Restrictions:

• Multi video streams are not handled.

• No special features for audio handling, audio is just copied to target file. With merge videos only the first audio track is copied.

Installation:

FFMPEG

If not already installed, follow the steps according: https://www.wikihow.com/Install-FFmpeg-on-Windows

Important: Set ffmpeg as environment variable, see step 13 of above link, or

https://www.addictivetips.com/windows-tips/set-path-environment-variables-in-windows-10/

The environment path must be e.g. C:\Programs\Video\ffmpeg\bin

VLC

If you want to use the internal player, install VLC from: https://www.videolan.org/vlc/download-windows.html

Alternatively the video is redirected to the standard player of your pc.

Matlab

Copy the FFmpegGui folder anywhere on your pc. Do not delete the ‘…/ffmpegGUI/Output’ folder. You may delete the ‘…/ffmpegGUI/SampleVideos’ folder.

更多精彩文章请关注公众号:【源码】FFmpegGUI:转换、修剪、裁剪、缩放、合并视频等_第2张图片

你可能感兴趣的:(【源码】FFmpegGUI:转换、修剪、裁剪、缩放、合并视频等)