0

我有一个 BMP 图像序列,我用这个 FFMPEG 代码将它们连接到一个 MPNG 视频文件:

ffmpeg -f image2 -framerate 12 -i "Frame_%d.bmp" -c:v png "Video.avi"

我想用 alpha 层中的透明度替换所有黑色像素,这样它就可以覆盖在编辑器中的其他视频上。以下代码不起作用:

ffmpeg -f image2 -framerate 12 -i "Frame_%d.bmp" -filter_complex "[0:v]colorkey=0x000000:0.01:0.0[BlackToTransparancy]" -map [BlackToTransparancy] -c:v png "Video.avi"

根据要求,这是完整的日志:

ffmpeg version N-93020-g3224d6691c Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181201
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 44.100 / 58. 44.100
  libavformat    58. 26.100 / 58. 26.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, image2, from 'D:\ReadOut_Process\Test\Test__Frame_%d.bmp':
  Duration: 00:00:16.83, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: bmp, bgra, 1280x720, 12 tbr, 12 tbn, 12 tbc
Stream mapping:
  Stream #0:0 (bmp) -> colorkey
  colorkey -> Stream #0:0 (png)
Press [q] to stop, [?] for help
Output #0, avi, to 'D:\ReadOut_Process\Test\Test__Scribe.avi':
  Metadata:
    ISFT            : Lavf58.26.100
    Stream #0:0: Video: png (MPNG / 0x474E504D), rgba, 1280x720, q=2-31, 200 kb/s, 12 fps, 12 tbn, 12 tbc
    Metadata:
      encoder         : Lavc58.44.100 png
frame=   34 fps=0.0 q=-0.0 size=     774kB time=00:00:02.16 bitrate=2924.7kbits/s speed=4.21x    
frame=   65 fps= 64 q=-0.0 size=    1798kB time=00:00:04.75 bitrate=3100.1kbits/s speed=4.66x    
frame=   95 fps= 62 q=-0.0 size=    3078kB time=00:00:07.25 bitrate=3477.4kbits/s speed=4.76x    
frame=  124 fps= 61 q=-0.0 size=    4358kB time=00:00:09.66 bitrate=3692.8kbits/s speed=4.76x    
frame=  155 fps= 61 q=-0.0 size=    6150kB time=00:00:12.25 bitrate=4112.4kbits/s speed=4.83x    
frame=  185 fps= 61 q=-0.0 size=    7686kB time=00:00:14.75 bitrate=4268.5kbits/s speed=4.84x    
frame=  202 fps= 58 q=-0.0 Lsize=    9187kB time=00:00:16.83 bitrate=4470.8kbits/s speed=4.83x    
video:9176kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.112806%

BMP 太大而无法上传,但这里有一个典型部分的链接:https ://pasteboard.co/I0RzfjI.bmp

可以做到吗?

4

0 回答 0