[FFmpeg-user] Bit Depth of PNG Overlay with Alpha channel
Pete Willis
pete at flatgrey.com
Sat Nov 25 11:50:31 EET 2017
We have a transparent PNG file with a drop shadow. The drop shadow when overlayed onto a Mov is rendering very dark.
Comparing the same file in an NLE (Premiere Pro) the drop shadow opacity is showing as much lighter.
I believe the problem is that the NLE is using 32bit colour depth where as FFMPEG is using 8bit colour depth. Is there a way to specify the colour depth of the overlay or the png?
The param we are using is -filter_complex ‘overlay’,
Input:
ffmpeg -I TEST-1.mxf -i test-1.png -filter_complex 'overlay[out]' -c:v libx264 -profile high10 -map '[out]' out2.mp4
Output:
ffmpeg version 3.4-tessus Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Guessed Channel Layout for Input Stream #0.1 : mono
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Guessed Channel Layout for Input Stream #0.4 : mono
Input #0, mxf, from '/Users/petew/Downloads/Video/Nov - 17/IN_GAME_1ST_THvMC_2_171101_BC_TEST07.mxf':
Metadata:
uid : 0b60c130-c23e-11e6-9861-8cdcd4127984
generation_uid : 0b60c130-c23e-11e6-9862-8cdcd4127984
company_name : OC
product_name : OCTk
product_version : 2.8
product_uid : 3a4fe380-0d01-11e4-869f-3cd92b5c1dfc
modification_date: 2016-12-14T20:44:01.000000Z
material_package_umid: 0x060A2B340101010501010D20130000000B60C130C23E11E698488CDCD4127984
timecode : 00:00:00:00
Duration: 00:00:22.68, start: 0.000000, bitrate: 55110 kb/s
Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 50000 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
Metadata:
file_package_umid: 0x060A2B340101010501010D20130000000B60C130C23E11E698328CDCD4127984
Stream #0:1: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
Metadata:
file_package_umid: 0x060A2B340101010501010D20130000000B60C130C23E11E698328CDCD4127984
Stream #0:2: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
Metadata:
file_package_umid: 0x060A2B340101010501010D20130000000B60C130C23E11E698328CDCD4127984
Stream #0:3: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
Metadata:
file_package_umid: 0x060A2B340101010501010D20130000000B60C130C23E11E698328CDCD4127984
Stream #0:4: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
Metadata:
file_package_umid: 0x060A2B340101010501010D20130000000B60C130C23E11E698328CDCD4127984
Input #1, png_pipe, from '/Users/petew/Downloads/Images/Nov - 17/GCCM0632000H Art Card lease hisp-1.png':
Duration: N/A, bitrate: N/A
Stream #1:0: Video: png, rgba(pc), 1920x1080, 25 tbr, 25 tbn, 25 tbc
File '/Users/petew/Desktop/out3.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
Stream #0:0 (mpeg2video) -> overlay:main
Stream #1:0 (png) -> overlay:overlay
overlay -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[libx264 @ 0x7fed7d067200] using SAR=1/1
[libx264 @ 0x7fed7d067200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x7fed7d067200] profile High, level 4.0
[libx264 @ 0x7fed7d067200] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - 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=6 lookahead_threads=1 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 '/Users/petew/Desktop/out3.mp4':
Metadata:
uid : 0b60c130-c23e-11e6-9861-8cdcd4127984
generation_uid : 0b60c130-c23e-11e6-9862-8cdcd4127984
company_name : OC
product_name : OCTk
product_version : 2.8
product_uid : 3a4fe380-0d01-11e4-869f-3cd92b5c1dfc
modification_date: 2016-12-14T20:44:01.000000Z
material_package_umid: 0x060A2B340101010501010D20130000000B60C130C23E11E698488CDCD4127984
timecode : 00:00:00:00
encoder : Lavf57.83.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
encoder : Lavc57.107.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 567 fps=9.5 q=-1.0 Lsize= 19074kB time=00:00:22.56 bitrate=6926.1kbits/s speed=0.379x
video:19066kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.042688%
[libx264 @ 0x7fed7d067200] frame I:3 Avg QP:20.30 size:129098
[libx264 @ 0x7fed7d067200] frame P:160 Avg QP:23.36 size: 62461
[libx264 @ 0x7fed7d067200] frame B:404 Avg QP:25.84 size: 22628
[libx264 @ 0x7fed7d067200] consecutive B-frames: 3.2% 4.9% 1.6% 90.3%
[libx264 @ 0x7fed7d067200] mb I I16..4: 24.2% 62.7% 13.0%
[libx264 @ 0x7fed7d067200] mb P I16..4: 4.2% 14.3% 1.6% P16..4: 35.2% 11.8% 7.3% 0.0% 0.0% skip:25.5%
[libx264 @ 0x7fed7d067200] mb B I16..4: 0.9% 1.2% 0.3% B16..8: 36.4% 5.7% 1.4% direct: 4.6% skip:49.5% L0:43.3% L1:47.7% BI: 9.0%
[libx264 @ 0x7fed7d067200] 8x8 transform intra:66.5% inter:83.5%
[libx264 @ 0x7fed7d067200] coded y,uvDC,uvAC intra: 55.8% 55.6% 16.2% inter: 23.9% 18.8% 1.2%
[libx264 @ 0x7fed7d067200] i16 v,h,dc,p: 6% 67% 3% 24%
[libx264 @ 0x7fed7d067200] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 37% 27% 2% 2% 2% 4% 2% 8%
[libx264 @ 0x7fed7d067200] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 66% 10% 2% 2% 2% 2% 2% 3%
[libx264 @ 0x7fed7d067200] i8c dc,h,v,p: 52% 30% 12% 6%
[libx264 @ 0x7fed7d067200] Weighted P-Frames: Y:1.2% UV:0.6%
[libx264 @ 0x7fed7d067200] ref P L0: 49.3% 17.3% 24.0% 9.3% 0.1%
[libx264 @ 0x7fed7d067200] ref B L0: 85.6% 11.4% 3.0%
[libx264 @ 0x7fed7d067200] ref B L1: 94.4% 5.6%
[libx264 @ 0x7fed7d067200] kb/s:6886.28
Thanks
More information about the ffmpeg-user
mailing list