<p>I need to blend an video with an semitransparent png like this:</p>

<p><code>[1:0][0:0]blend=all_mode=average</code>   </p>

<p>Seems like the transparency of png is ignored.</p>

<ul>
<li>What I missed? </li>
<li>How to make the ffmpeg to respect the overlay`s alpha channel?</li>
</ul>

<p>Full example of my settings:</p>

<pre><code>ffmpeg \
-i background.mp4 \
-loop 1 -f image2 -i transparent-overlay.png \
-shortest -y \
-filter_complex "[1:0][0:0]blend=all_mode=average" \
overlay.mp4
</code></pre>

<p>Output:</p>

<pre><code>ffmpeg version 2.4.3- http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2014 the FFmpeg developers
built on Nov 4 2014 13:14:24 with gcc 4.8 (Debian 4.8.3-13)
configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'background.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.4.101
Duration: 00:01:36.40, start: 0.033333, bitrate: 1132 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 999 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, image2, from 'transparent-overlay.png':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #1:0: Video: png, rgba, 640x360 [SAR 2835:2835 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
[libx264 @ 0x3580cc0] using SAR=1/1
[libx264 @ 0x3580cc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x3580cc0] profile High, level 3.0
[libx264 @ 0x3580cc0] 264 - core 142 r50 dd79a61 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'overlay.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.4.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
encoder : Lavc56.1.100 libx264
Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc56.1.100 libvo_aacenc
Stream mapping:
Stream #0:0 (h264) -&gt; blend:bottom (graph 0)
Stream #1:0 (png) -&gt; blend:top (graph 0)
blend (graph 0) -&gt; Stream #0:0 (libx264)
Stream #0:1 -&gt; #0:1 (aac (native) -&gt; aac (libvo_aacenc))
Press [q] to stop, [?] for help
frame= 81 fps=0.0 q=28.0 size= 78kB time=00:00:03.52 bitrate= 180.7kbits
...
frame= 2468 fps=146 q=-1.0 Lsize= 7220kB time=00:01:38.64 bitrate= 599.6kbits/s
video:5643kB audio:1507kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.981916%
[libx264 @ 0x3580cc0] frame I:11 Avg QP:19.23 size: 16922
[libx264 @ 0x3580cc0] frame P:1104 Avg QP:21.09 size: 4387
[libx264 @ 0x3580cc0] frame B:1353 Avg QP:24.45 size: 553
[libx264 @ 0x3580cc0] consecutive B-frames: 25.4% 0.4% 12.6% 61.6%
[libx264 @ 0x3580cc0] mb I I16..4: 14.3% 65.2% 20.6%
[libx264 @ 0x3580cc0] mb P I16..4: 0.1% 0.9% 0.1% P16..4: 35.2% 17.4% 8.8% 0.0% 0.0% skip:37.4%
[libx264 @ 0x3580cc0] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 31.4% 1.0% 0.2% direct: 0.6% skip:66.7% L0:31.0% L1:63.0% BI: 6.0%
[libx264 @ 0x3580cc0] 8x8 transform intra:72.5% inter:64.9%
[libx264 @ 0x3580cc0] coded y,uvDC,uvAC intra: 80.7% 54.2% 7.2% inter: 15.9% 6.9% 0.0%
[libx264 @ 0x3580cc0] i16 v,h,dc,p: 28% 43% 7% 22%
[libx264 @ 0x3580cc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 38% 14% 3% 6% 3% 15% 2% 10%
[libx264 @ 0x3580cc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 41% 11% 3% 7% 3% 15% 2% 10%
[libx264 @ 0x3580cc0] i8c dc,h,v,p: 51% 37% 9% 3%
[libx264 @ 0x3580cc0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x3580cc0] ref P L0: 69.3% 20.7% 8.2% 1.7%
[libx264 @ 0x3580cc0] ref B L0: 96.7% 2.9% 0.4%
[libx264 @ 0x3580cc0] ref B L1: 96.0% 4.0%
[libx264 @ 0x3580cc0] kb/s:468.21 
</code></pre>

CC BY-SA 3.0
2014-11-30T18:53:31.167Z
Please show the complete `ffmpeg` console output from your command.
llogan
CC BY-SA 3.0
2014-11-30T19:57:45.250Z
@LordNeckbeard, [complete log](https://gist.github.com/peko/3410a6d7326a6c69b871)
peko
CC BY-SA 3.0
2014-12-01T19:38:30.877Z
I don't have an answer for this one. The [docs](http://ffmpeg.org/ffmpeg-filters.html#blend) for this filter could use some improvement to make them easier to follow. Try the [ffmpeg-user mailing list](http://ffmpeg.org/contact.html).
llogan
<ffmpeg><composing>
The ffmpeg`s filter_complex blend respecting overlay`s alpha channel
peko
# The ffmpeg`s filter_complex blend respecting overlay`s alpha channel

(Asked by: username_0 on 2014-11-30)

I need to blend an video with an semitransparent png like this:
[1:0][0:0]blend=all_mode=average 
Seems like the transparency of png is ignored.

What I missed? 
How to make the ffmpeg to respect the overlay`s alpha channel?

Full example of my settings:
ffmpeg \
-i background.mp4 \
-loop 1 -f image2 -i transparent-overlay.png \
-shortest -y \
-filter_complex "[1:0][0:0]blend=all_mode=average" \
overlay.mp4

Output:
ffmpeg version 2.4.3- http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2014 the FFmpeg developers
built on Nov 4 2014 13:14:24 with gcc 4.8 (Debian 4.8.3-13)
configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'background.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.4.101
Duration: 00:01:36.40, start: 0.033333, bitrate: 1132 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 999 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, image2, from 'transparent-overlay.png':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #1:0: Video: png, rgba, 640x360 [SAR 2835:2835 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
[libx264 @ 0x3580cc0] using SAR=1/1
[libx264 @ 0x3580cc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x3580cc0] profile High, level 3.0
[libx264 @ 0x3580cc0] 264 - core 142 r50 dd79a61 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'overlay.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.4.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
encoder : Lavc56.1.100 libx264
Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc56.1.100 libvo_aacenc
Stream mapping:
Stream #0:0 (h264) -> blend:bottom (graph 0)
Stream #1:0 (png) -> blend:top (graph 0)
blend (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (aac (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help
frame= 81 fps=0.0 q=28.0 size= 78kB time=00:00:03.52 bitrate= 180.7kbits
...
frame= 2468 fps=146 q=-1.0 Lsize= 7220kB time=00:01:38.64 bitrate= 599.6kbits/s
video:5643kB audio:1507kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.981916%
[libx264 @ 0x3580cc0] frame I:11 Avg QP:19.23 size: 16922
[libx264 @ 0x3580cc0] frame P:1104 Avg QP:21.09 size: 4387
[libx264 @ 0x3580cc0] frame B:1353 Avg QP:24.45 size: 553
[libx264 @ 0x3580cc0] consecutive B-frames: 25.4% 0.4% 12.6% 61.6%
[libx264 @ 0x3580cc0] mb I I16..4: 14.3% 65.2% 20.6%
[libx264 @ 0x3580cc0] mb P I16..4: 0.1% 0.9% 0.1% P16..4: 35.2% 17.4% 8.8% 0.0% 0.0% skip:37.4%
[libx264 @ 0x3580cc0] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 31.4% 1.0% 0.2% direct: 0.6% skip:66.7% L0:31.0% L1:63.0% BI: 6.0%
[libx264 @ 0x3580cc0] 8x8 transform intra:72.5% inter:64.9%
[libx264 @ 0x3580cc0] coded y,uvDC,uvAC intra: 80.7% 54.2% 7.2% inter: 15.9% 6.9% 0.0%
[libx264 @ 0x3580cc0] i16 v,h,dc,p: 28% 43% 7% 22%
[libx264 @ 0x3580cc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 38% 14% 3% 6% 3% 15% 2% 10%
[libx264 @ 0x3580cc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 41% 11% 3% 7% 3% 15% 2% 10%
[libx264 @ 0x3580cc0] i8c dc,h,v,p: 51% 37% 9% 3%
[libx264 @ 0x3580cc0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x3580cc0] ref P L0: 69.3% 20.7% 8.2% 1.7%
[libx264 @ 0x3580cc0] ref B L0: 96.7% 2.9% 0.4%
[libx264 @ 0x3580cc0] ref B L1: 96.0% 4.0%
[libx264 @ 0x3580cc0] kb/s:468.21

**Tags:** ffmpeg, composing

> **Comments:**
> **username_1**: Please show the complete `ffmpeg` console output from your command.  
> **username_0**: @LordNeckbeard, [complete log](https://gist.github.com/username_0/3410a6d7326a6c69b871)  
> **username_1**: I don't have an answer for this one. The [docs](http://ffmpeg.org/ffmpeg-filters.html#blend) for this filter could use some improvement to make them easier to follow. Try the [ffmpeg-user mailing list](http://ffmpeg.org/contact.html).  

---

## 0 answers

