[FFmpeg-user] Help with complex filter chain?

Mike Grommet mgrommet at techfriends.com
Thu Nov 26 07:54:44 CET 2015


Hi group,  here is what I'm trying to do:

I have one background, and two videos
- I'd like to scale each video down to 320x240
- hstack them next to each other
- overlay them over a background image
- Merge the audio from the 2 videos, and map it to the final output


Here is what I have so far -- but it doesn't work, I get nothing but a 
blank video output.
I'm pretty inexperienced with ffmpeg, so I'm sure I'm probably missing 
something dumb trying to chain all of the filters together...

  ffmpeg -i Background.png -i a.webm -i b.webm -loop 1 -filter_complex 
"[0:v]overlay=0:57:shortest=1[c];[1:v]scale=320:240[left];[2:v]scale=320:240[right];[1:a][2:a]amerge=inputs=2[a];[left][right]hstack[out]" 
-map [out] -map "[c]" -map "[a]" blah.webm

Any advice?   I've included the initial ffmpeg output below, in case it 
might be helpful.


ffmpeg version N-76637-gedd0c1d Copyright (c) 2000-2015 the FFmpeg 
developers
   built with gcc 5.2.0 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads 
--enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r 
--enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b 
--enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm 
--enable-l
ibilbc --enable-libmodplug --enable-libmp3lame 
--enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus 
--enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex 
--enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc 
--enable-libvo-amrwbenc
  --enable-libvorbis --enable-libvpx --enable-libwavpack 
--enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid 
--enable-libzimg --
enable-lzma --enable-decklink --enable-zlib
   libavutil      55.  5.100 / 55.  5.100
   libavcodec     57. 15.100 / 57. 15.100
   libavformat    57. 14.100 / 57. 14.100
   libavdevice    57.  0.100 / 57.  0.100
   libavfilter     6. 15.100 /  6. 15.100
   libswscale      4.  0.100 /  4.  0.100
   libswresample   2.  0.101 /  2.  0.101
   libpostproc    54.  0.100 / 54.  0.100
[png @ 0000000000455060] Broken zTXt chunk
     Last message repeated 2 times
Input #0, png_pipe, from 'FinalBackground.png':
   Duration: N/A, bitrate: N/A
     Stream #0:0: Video: png, rgb24(pc), 1280x720 [SAR 2834:2834 DAR 
16:9], 25 tb
r, 25 tbn, 25 tbc
Input #1, matroska,webm, from 'a.webm':
   Metadata:
     encoder         : GStreamer matroskamux version 1.5.91
     creation_time   : 2015-10-29 12:59:45
   Duration: 00:00:59.24, start: 0.000000, bitrate: 442 kb/s
     Stream #1:0(eng): Video: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 1k 
tbr, 1k
tbn, 1k tbc (default)
     Metadata:
       title           : Video
     Stream #1:1(eng): Audio: vorbis, 48000 Hz, stereo, fltp (default)
     Metadata:
       title           : Audio
Input #2, matroska,webm, from 'b.webm':
   Metadata:
     encoder         : GStreamer matroskamux version 1.5.91
     creation_time   : 2015-10-29 12:59:45
   Duration: 00:00:59.24, start: 0.000000, bitrate: 494 kb/s
     Stream #2:0(eng): Video: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 1k 
tbr, 1k
tbn, 1k tbc (default)
     Metadata:
       title           : Video
     Stream #2:1(eng): Audio: vorbis, 48000 Hz, stereo, fltp (default)
     Metadata:
       title           : Audio
File 'blah.webm' already exists. Overwrite ? [y/N] y
[Parsed_amerge_3 @ 00000000004c8580] No channel layout for input 1
[Parsed_amerge_3 @ 00000000004c8580] Input channel layouts overlap: 
output layout will be determined by the number of distinct input channels
[libvpx-vp9 @ 0000000002d33320] v1.5.0
[libvpx-vp9 @ 0000000002d13560] v1.5.0
[libopus @ 00000000004de020] No bit rate set. Defaulting to 256000 bps.
Output #0, webm, to 'blah.webm':
   Metadata:
     encoder         : Lavf57.14.100
     Stream #0:0: Video: vp9 (libvpx-vp9), yuv420p, 640x240 [SAR 1:1 DAR 
8:3], q=
-1--1, 200 kb/s, 1k fps, 1k tbn, 1k tbc
     Metadata:
       encoder         : Lavc57.15.100 libvpx-vp9
     Stream #0:1: Video: vp9 (libvpx-vp9), yuv420p, 1280x720 [SAR 1:1 
DAR 16:9],
q=-1--1, 200 kb/s, 25 fps, 1k tbn, 25 tbc
     Metadata:
       encoder         : Lavc57.15.100 libvpx-vp9
     Stream #0:2: Audio: opus (libopus), 48000 Hz, 5.0, flt, 256 kb/s 
(default)
     Metadata:
       encoder         : Lavc57.15.100 libopus
Stream mapping:
   Stream #0:0 (png) -> overlay:main
   Stream #1:0 (vp8) -> overlay:overlay
   Stream #1:0 (vp8) -> scale
   Stream #1:1 (vorbis) -> amerge:in0
   Stream #2:0 (vp8) -> scale
   Stream #2:1 (vorbis) -> amerge:in1
   hstack -> Stream #0:0 (libvpx-vp9)
   overlay -> Stream #0:1 (libvpx-vp9)
   amerge -> Stream #0:2 (libopus)





More information about the ffmpeg-user mailing list