我有两个视频,我需要去掉两个视频的两端,只留下中间部分,然后将中间部分连接在一起。两个视频的来源完全相同 - 相同的 FPS 和相同的编解码器。
我正在尝试做的事情:
ffmpeg -i 0.mp4 -c:v h264_nvenc -preset fast -rc vbr -qmin 1 -qmax 1 -filter_complex "[0:v]trim=start=01.00:duration=03.00,setpts=PTS-STARTPTS[vmiddle]" -map [vmiddle] middle_0.mp4
ffmpeg -i 1.mp4 -c:v h264_nvenc -preset fast -rc vbr -qmin 1 -qmax 1 -filter_complex "[0:v]trim=start=01.00:duration=03.00,setpts=PTS-STARTPTS[vmiddle]" -map [vmiddle] middle_1.mp4
Run Code Online (Sandbox Code Playgroud)
这两个命令只剪切每个视频的中间部分,从 01.00 开始到 04.00 结束。
然后我连接视频:
ffmpeg -y -f concat -i concat.txt -c copy concat.mp4
Run Code Online (Sandbox Code Playgroud)
concat.txt 文件显然包含:
file 'middle0.mp4'
file 'middle1.mp4'
Run Code Online (Sandbox Code Playgroud)
但这不起作用。输出视频concat.mp4包含奇怪的故障,我在控制台中收到很多错误:
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025ead60] Auto-inserting h264_mp4toannexb bitstream filter
[concat @ 0000000000dd6bc0] DTS 34666 < 45568 …Run Code Online (Sandbox Code Playgroud) 在我的 cygwin 环境中拥有 matplotlib 会非常好。我有 64 位 Windows 8 和 64 位 cygwin。
当我输入:
pip install matplotlib
Run Code Online (Sandbox Code Playgroud)
我收到以下错误消息:
* The following required packages can not be built:
* freetype
Run Code Online (Sandbox Code Playgroud)
根据 apt-cyg 我已经安装了以下软件包:
Searching for installed packages matching freetype:
cygwin32-freetype2
freetype2-debuginfo
libfreetype-devel
libfreetype-doc
libfreetype6
Run Code Online (Sandbox Code Playgroud)
它还需要什么?如何正确安装 freetype 和 matplotlib?