尝试制作动画时,Quicktime无法读取ffmpeg
的输出。它将上传到imgur,并且没有问题。 previous thread建议我添加-pix_fmt yuv420p
标志。但是,在我的系统上,这不起作用。当我排除ffmpeg
标志时,pix_fmt
的运行没有错误,但是我无法在快速时间内打开输出动画。
为什么不能快速打开动画?如何使动画快速打开?
$ ffmpeg -y -i animation/tigers_${ii}_%05d.png -pix_fmt yuv420p tiger${ii}.mp4
ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0.2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
Input #0, image2, from 'animation/tigers_1.10_%05d.png':
Duration: 00:00:08.32, start: 0.000000, bitrate: N/A
Stream #0:0: Video: png, rgba(pc), 2023x3036 [SAR 17716:17716 DAR 2023:3036], 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (png (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x7fdd7b800c00] width not divisible by 2 (2023x3036)
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
答案 0 :(得分:1)
错误已清除
[libx264 @ 0x7fdd7b800c00] width not divisible by 2 (2023x3036)
使用裁切滤镜去除一列像素:
ffmpeg -y -i animation/tigers_${ii}_%05d.png -vf "crop='iw-mod(iw,2)':'ih-mod(ih,2)',format=yuv420p" tiger${ii}.mp4
-pix_fmt
选项等效于将格式过滤器添加为最后一个过滤器。