ffmpeg 使用filter_complex,colorkey和vn

1. 使用ffmpeg的filter_complex,colorkey和vn結果app

./ffmpeg -i likeyou.mp4 -i adium.png -filter_complex "[1:v]colorkey=0x3BBD1E:0.1:0.2[ckout0];[0:v][ckout0]overlay=x=W-w-11:y=10"  -vn -report  -t 10 -y -f flv test_out1.flv

 139 [flv @ 0x4459fa0] intra_quant_bias = 0 inter_quant_bias = -64
 140 Output #0, flv, to 'test_out1.flv':
 141   Metadata:
 142     major_brand     : isom
 143     minor_version   : 1
 144     compatible_brands: isomavc1
 145     encoder         : Lavf57.25.100
 146     Stream #0:0, 0, 1/1000: Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc (default)
 147     Metadata:
 148       encoder         : Lavc57.24.102 flv
 149     Side data:
 150       unknown side data type 10 (24 bytes)
 151     Stream #0:1(und), 0, 1/1000: Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 44100 Hz, stereo, fltp (default)
 152     Metadata:
 153       creation_time   : 2014-03-13 21:31:57
 154       handler_name    : sound
 155       encoder         : Lavc57.24.102 libmp3lame
 156 Stream mapping:
 157   Stream #0:0 (h264) -> overlay:main (graph 0)
 158   Stream #1:0 (png) -> colorkey (graph 0)
 159   overlay (graph 0) -> Stream #0:0 (flv)
 160   Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))

使用ffprobe分析輸出視頻ide

./ffprobe test_out1.flv 
ffprobe version 3.0-static32: Copyright (c) 2007-2016 the FFmpeg developers32:
  configuration: --enable-gpl --enable-nonfree --disable-shared --enable-postproc --enable-bzlib --enable-zlib --enable-parsers --enable-libx264 --enable-libx265 --enable-libmp3lame --enable-libfaac --enable-libfdk-aac --enable-pthreads --extra-ldflags=-static --disable-ffserver --enable-ffplay --enable-asm --enable-yasm --enable-optimizations --pkg-config-flags=--static --extra-cflags=--static --extra-version=static --enable-libspeex --extra-ldflags=-L/usr/local/lib --extra-cflags=-I/usr/local/include --extra-libs=-lrtmp
  libavutil      55. 17.103 / 55. 17.103
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
  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
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[flv @ 0x30202e0] decoding video .......
Input #0, flv, from 'test_out1.flv':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    encoder         : Lavf57.25.10032:
  Duration: 00:00:10.0032:, start: 0.00000032:, bitrate: 603 kb/s32:
    Stream #0:0: Video: flv1, yuv420p, 640x360, 200 kb/s, 25 fps, 25 tbr, 1k tbn, 1k tbc
    Stream #0:1: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s

結論:post

即便設置了vn,可是在有濾鏡的狀況下,仍然會輸出視頻數據。ui

 

2. 有vn,沒有濾鏡code

./ffmpeg -i likeyou.mp4 -i adium.png -vn -report  -t 10 -y -f flv test_out1.flv -v 48
 103 [AVFilterGraph @ 0x26ff340] query_formats: 5 queried, 12 merged, 0 already done, 0 delayed
 104 Output #0, flv, to 'test_out1.flv':
 105   Metadata:
 106     major_brand     : isom
 107     minor_version   : 1
 108     compatible_brands: isomavc1
 109     encoder         : Lavf57.25.100
 110     Stream #0:0(und), 0, 1/1000: Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 44100 Hz, stereo, fltp (default)
 111     Metadata:
 112       creation_time   : 2014-03-13 21:31:57
 113       handler_name    : sound
 114       encoder         : Lavc57.24.102 libmp3lame
 115 Stream mapping:
 116   Stream #0:1 -> #0:0 (aac (native) -> mp3 (libmp3lame))

 

3. 沒有濾鏡,沒有vnorm

./ffmpeg -i likeyou.mp4 -i adium.png -report  -t 10 -y -f flv test_out1.flv -v 48
 114 [flv @ 0x30a9e80] intra_quant_bias = 0 inter_quant_bias = -64
 115 Output #0, flv, to 'test_out1.flv':
 116   Metadata:
 117     major_brand     : isom
 118     minor_version   : 1
 119     compatible_brands: isomavc1
 120     encoder         : Lavf57.25.100
 121     Stream #0:0(und), 0, 1/1000: Video: flv1 (flv), 1 reference frame ([2][0][0][0] / 0x0002), yuv420p(left), 640x360 [SAR 1:1 DAR 16:9], 1/25, q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc (default)
 122     Metadata:
 123       creation_time   : 2014-03-13 21:31:56
 124       handler_name    : video
 125       encoder         : Lavc57.24.102 flv
 126     Side data:
 127       unknown side data type 10 (24 bytes)
 128     Stream #0:1(und), 0, 1/1000: Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 44100 Hz, stereo, fltp (default)
 129     Metadata:
 130       creation_time   : 2014-03-13 21:31:57
 131       handler_name    : sound
 132       encoder         : Lavc57.24.102 libmp3lame
 133 Stream mapping:
 134   Stream #0:0 -> #0:0 (h264 (native) -> flv1 (flv))
 135   Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
相關文章
相關標籤/搜索