【发布时间】:2018-03-15 21:39:17
【问题描述】:
我正在尝试使用一组带有ffmpeg 的定时屏幕截图创建两部电影,并使用-f concat 指定png 屏幕截图和它们应该显示的持续时间。我主要从 ffmpeg slideshow tutorial
和concat documentation。 Quicktime 能够毫无问题地打开我的两部 ffmpeg 生成的电影,但是尽管使用相同的命令和脚本来创建它们,iMovie 可以毫无问题地打开一个并且永远不会打开另一个,无论我重新创建源屏幕截图/持续时间多少次并重新制作视频。
我有两个从我的输入中捕获并转换为 png 的屏幕,我正在尝试生成两部电影以导入 iMovie 并同时并排显示。为了生成电影,我使用以下命令:
ffmpeg -f concat -i win1input.txt -vsync vfr -pix_fmt yuv420p win1.mov
ffmpeg -f concat -i win2input.txt -vsync vfr -pix_fmt yuv420p win2.mov
win1input.txt 和 win2input.txt 本质上是相同的(由具有不同文件名和时间的相同脚本生成):
file 'win1-01.png'
duration 3.07
file 'win1-02.png'
duration 2.55
...
两部电影都是生成的,可以通过 quicktime 打开而没有任何投诉。但是,当我尝试将它们导入 iMovie 时,第一部电影总是可以正常导入,而第二部电影则出现错误“无可导入文件”,并且在媒体预览窗口中的持续时间为 0。
任何人都可以建议观看电影的方法并尝试找到可能引发 iMovie 的内容吗?没有更详细的错误,我被卡住了。而且我完全不知道两者之间的区别是什么,因为它们是从相同的进程、编解码器等生成的。任何有关电影的进一步信息的帮助或建议将不胜感激!
更新ffmpeg -i 输出:
$ ffmpeg -i badMovie.mov
ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 8.1.0 (clang-802.0.42)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libass --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --enable-openssl --disable-lzma --enable-nonfree --enable-vda
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'badMovie.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf56.40.101
Duration: 00:02:09.84, start: 0.000000, bitrate: 36 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x800, 35 kb/s, 0.28 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : DataHandler
encoder : Lavc56.60.100 libx264
$ ffmpeg -i goodMovie.mov
ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 8.1.0 (clang-802.0.42)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.2 --enable-shared -- enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libass --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --enable-openssl --disable-lzma --enable-nonfree --enable-vda
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'goodMovie.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf56.40.101
Duration: 00:02:11.84, start: 0.000000, bitrate: 13 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x800, 13 kb/s, 0.64 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : DataHandler
encoder : Lavc56.60.100 libx264
【问题讨论】:
-
ffmpeg -i的两个输出文件的输出是什么? -
好问题 - 在上面更新。
-
可能是糟糕的电影低于帧率阈值。添加
-r 5并查看。 -
感谢@Mulvya - 成功了。从您的建议中添加了一个已接受的答案。