I have a transparent webm video I generated using a slightly modified version of electron-recorder
that I need to overlay on an MP4 video from a smartphone. I've tried using the overlay
filter but it always puts a black background on the overlay instead of transparent. I am sure that the overlay has a transparent background. I can play it in a webpage and the background shows through.
What command would I need to get this working?
This is the command I used to generate the webm
from transparent PNGs (extracted and modified from electron-recorder
for my testing): cat *.png | ffmpeg -y -f image2pipe -r 30 -i - -c:v libvpx -pix_fmt yuva420p -metadata:s:v:0 alpha_mode="1" output.webm
Here is the output of ffprobe overlay.webm
:
ffprobe version 3.0.2 Copyright (c) 2007-2016 the FFmpeg developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libvorbis --enable-libvpx --enable-libfaac --enable-libass --enable-ffplay --enable-libfdk-aac --enable-libopus --enable-libx265 --disable-lzma --enable-nonfree --enable-vda
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, matroska,webm, from 'overlay.webm':
Metadata:
encoder : Lavf57.25.100
Duration: 00:00:01.77, start: 0.000000, bitrate: 152 kb/s
Stream #0:0: Video: vp8, yuv420p, 720x720, SAR 1:1 DAR 1:1, 30 fps, 30 tbr, 1k tbn, 1k tbc (default)
Metadata:
alpha_mode : 1
ffplay in.webm -vf alphaextract
. If you see a full white output or there's an error, then there's no transparency.ffprobe in.webm
into your Q.