[FFmpeg Cmd]滤镜特效调研实现

O 说明

http://www.ffmpeg.org/ffmpeg-filters.html#toc-Timeline-editing

5 Timeline editing

Some filters support a generic <samp>enable</samp> option. For the filters supporting timeline editing, this option can be set to an expression which is evaluated before sending a frame to the filter. If the evaluation is non-zero, the filter will be enabled, otherwise the frame will be sent unchanged to the next filter in the filtergraph.

The expression accepts the following values:

‘t’timestamp expressed in seconds, NAN if the input timestamp is unknown‘n’sequential number of the input frame, starting from 0‘pos’the position in the file of the input frame, NAN if unknown‘w’‘h’width and height of the input frame if video

Additionally, these filters support an <samp>enable</samp> command that can be used to re-define the expression.

Like any other filtering option, the <samp>enable</samp> option follows the same rules.

For example, to enable a blur filter (smartblur) from 10 seconds to 3 minutes, and a curves filter starting at 3 seconds:

<pre class="example" style="margin: 10px 0px 0px; padding: 0px; font-family: ConfluenceInstalledFont, monospace; color: rgb(51, 51, 51); font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">smartblur = enable='between(t,10,3*60)',
curves = enable='gte(t,3)' : preset=cross_process
</pre>

See ffmpeg -filters to view which filters have timeline support.

1 滤镜

!/bin/bash
# Author: changyanlong01
# Created Time: Fri 21 Aug 2020 04:05:25 PM CST
 
#FFMPEG="./ffmpeg"
FFMPEG="ffmpeg"
FFMPEG_INPUT=" -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png "
FFMPEG_OUTPUT=" -map '[result]' -vcodec libx264 -an -y "
 
WIDTH=900
HEIGHT=422
SCALE="${WIDTH}:${HEIGHT}"
 
VIDEO_IDX=0
 
CMD_FILE='cmd.sh'
echo "set -x" > $CMD_FILE
 
function execFFmpeg() {
    local fiterContent=${1}
    local outputname=${2}
    local filterComplex=" -filter_complex \"[0:v]${fiterContent}[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]\""
 
    #ffmpegStr="$FFMPEG_INPUT $filterComplex $FFMPEG_OUTPUT ./output/${VIDEO_IDX}.mp4"
    ffmpegStr="$FFMPEG_INPUT $filterComplex $FFMPEG_OUTPUT ./output/${outputname}.mp4"
    echo $ffmpegStr
    echo "$FFMPEG $ffmpegStr" >> $CMD_FILE
    #$FFMPEG $ffmpegStr
    ((VIDEO_IDX=VIDEO_IDX+1))
}
 

#
# 老版本滤镜
#
# 负片
execFFmpeg "negate" "老版本_负片"
# 模糊
execFFmpeg "boxblur=16:12:cr=0:ar=0" "老版本_模糊"
# 浮雕
execFFmpeg "format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'" "老版本_浮雕"
# 黑白
execFFmpeg "colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3" "老版本_黑白"
# 高亮
execFFmpeg "curves=r='0/0 0.05/0.1 0.4/0.6 1/1':g='0/0 0.05/0.1 0.4/0.6 1/1':b='0/0 0.05/0.1 0.4/0.6 1/1'" "老版本_高亮"
# 其他 曲线
execFFmpeg "curves=vintage" "老版本_vintage"
execFFmpeg "curves=strong_contrast" "老版本_strong_contrast"
execFFmpeg "curves=lighter" "老版本_lighter"
execFFmpeg "curves=negate" "老版本_negate"
execFFmpeg "curves=color_negative" "老版本_color_negative"
 
#
# 新调研
#
# 边缘检测
execFFmpeg "edgedetect" "edgedetect"
execFFmpeg "edgedetect=low=0.4:high=0.9" "edgedetect_low04_high09"
# 油画
execFFmpeg "edgedetect=mode=colormix:high=0" "edgedetect_colmix_high0"
execFFmpeg "edgedetect=mode=colormix:low=0.9:high=1" "edgedetect_colmix_low09_high0"
execFFmpeg "edgedetect=mode=colormix:low=0.4:high=0.9" "edgedetect_colmix_low_04_high0"
 
# 色彩时域
execFFmpeg "geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'" "gep1"
 
execFFmpeg "inflate" "inflate"
 
# 复制 同屏
execFFmpeg "il=l=i:c=i"
execFFmpeg "il=luma_mode=interleave:chroma_mode=interleave"
 
# YUV
execFFmpeg "lutyuv=y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val" "yuvcolor"
# 亮度 饱和度 对比度 gama
execFFmpeg "eq=contrast=1:brightness=-0.2:saturation=1.0" "epcontrast_brightness_sat_gamma"
execFFmpeg "eq=contrast=1:brightness=0.2:saturation=1.0" "epcontrast_brightness02_sat_gamma"
execFFmpeg "eq=contrast=1:brightness=0.2:saturation=1.0:gamma_r=10:gamma_g=1:gamma_b=5" "epcontrast_brightness_sat_gamma"
 
# 均匀噪声
execFFmpeg "noise=alls=20:allf=t+u" "noise_avg"
# 渐变
#execFFmpeg "fade=in:0:10"
execFFmpeg  "fade=type=out:st=13.218084:duration=1.000000:color=white"
 
# 锐化
execFFmpeg "unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5" "sharp"
 
# 反锐化
execFFmpeg "unsharp=7:7:-2:7:7:-2" "unsharp"
# 渐晕
execFFmpeg "vignette=PI/4" "vignette"
# 闪烁渐晕
execFFmpeg "vignette='PI/4+random(1)*PI/50':eval=frame" "vignette_light"
# 放大
execFFmpeg "crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2+((in_h-out_h)/2)*sin(n/7)[out];[out]scale=${SCALE}" "scale_bigger"
# 色泽
execFFmpeg "hue=H=2*PI*t:s=sin(2*PI*t)+1" "hue"
# 模糊
execFFmpeg "boxblur=5:1:cr=0:ar=0" "blur"
 
# 水平翻转
execFFmpeg "geq=p(W-X\\,Y)" "gep_hor"
# 垂直旋转
execFFmpeg "vflip" "vflip"
# 浮雕
execFFmpeg "format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'" "fudiao"
 
:<<!
5, colorchannelmixer  可以设置rgba四个分量的变换关系,共接受16个参数。
rr rg rb ra
gr gg gb ga
br bg bb ba
ar ag ab aa
参数本质就是加权求值时候的权重,每个参数接受0-1得值,滤镜本质是将每个颜色值加权求值.公式:
red=red*rr+blue*rb+green*rg+alpha*ra 。green/blue和alpha同理。参数默认值对应得是1,其他为0.如:rr,rg,rb,ra。其中rr默认为1,其他为0。
!
execFFmpeg "colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3" "colorchannelmixer1"
execFFmpeg "colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131" "colorchannelmixer2"
 
execFFmpeg "drawbox=x=100:y=100:w=iw/2:h=ih/2:c=red" "drawbox1"
execFFmpeg "drawgrid=width=100:height=100:thickness=2:color=black@0.9" "drawgrid"
 
 
 
# 调色
execFFmpeg "colorbalance=rs=.3" "colorbalance_rs03"
execFFmpeg "colorbalance=bs=.3" "colorbalance_bs03"
execFFmpeg "colorbalance=gs=.3" "colorbalance_gs03"
 
execFFmpeg "colorbalance=rm=.3" "colorbalance_rm03"
execFFmpeg "colorbalance=bm=.3" "colorbalance_bm03"
execFFmpeg "colorbalance=gm=.3" "colorbalance_gm03"
 
execFFmpeg "colorbalance=rh=.3" "colorbalance_rh03"
execFFmpeg "colorbalance=bh=.3" "colorbalance_bh03"
execFFmpeg "colorbalance=gh=.3" "colorbalance_gh03"
 
execFFmpeg "colorlevels=rimin=0.058:gimin=0.058:bimin=0.058" "colorlevels1"
execFFmpeg "colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96" "colorlevels2"
execFFmpeg "colorlevels=rimax=0.902:gimax=0.902:bimax=0.902" "colorlevels3"
execFFmpeg "colorlevels=romin=0.5:gomin=0.5:bomin=0.5" "colorlevels4"
 
# 直方图
execFFmpeg "histogram" "histogram"
 
execFilter

输出cmd

ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]negate[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/老版本_负片.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]boxblur=16:12:cr=0:ar=0[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/老版本_模糊.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/老版本_浮雕.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/老版本_黑白.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]curves=r='0/0 0.05/0.1 0.4/0.6 1/1':g='0/0 0.05/0.1 0.4/0.6 1/1':b='0/0 0.05/0.1 0.4/0.6 1/1'[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/老版本_高亮.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]curves=vintage[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/老版本_vintage.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]curves=strong_contrast[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/老版本_strong_contrast.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]curves=lighter[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/老版本_lighter.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]curves=negate[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/老版本_negate.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]curves=color_negative[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/老版本_color_negative.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]edgedetect[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/edgedetect.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]edgedetect=low=0.4:high=0.9[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/edgedetect_low04_high09.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]edgedetect=mode=colormix:high=0[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/edgedetect_colmix_high0.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]edgedetect=mode=colormix:low=0.9:high=1[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/edgedetect_colmix_low09_high0.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]edgedetect=mode=colormix:low=0.4:high=0.9[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/edgedetect_colmix_low_04_high0.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/gep1.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]inflate[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/inflate.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]il=l=i:c=i[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]il=luma_mode=interleave:chroma_mode=interleave[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]lutyuv=y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/yuvcolor.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]eq=contrast=1:brightness=-0.2:saturation=1.0[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/epcontrast_brightness_sat_gamma.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]eq=contrast=1:brightness=0.2:saturation=1.0[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/epcontrast_brightness02_sat_gamma.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]eq=contrast=1:brightness=0.2:saturation=1.0:gamma_r=10:gamma_g=1:gamma_b=5[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/epcontrast_brightness_sat_gamma.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]noise=alls=20:allf=t+u[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/noise_avg.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/sharp.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]unsharp=7:7:-2:7:7:-2[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/unsharp.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]vignette=PI/4[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/vignette.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]vignette='PI/4+random(1)*PI/50':eval=frame[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/vignette_light.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2+((in_h-out_h)/2)*sin(n/7)[out];[out]scale=900:422[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/scale_bigger.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]hue=H=2*PI*t:s=sin(2*PI*t)+1[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/hue.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]boxblur=5:1:cr=0:ar=0[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/blur.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]geq=p(W-X\,Y)[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/gep_hor.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]vflip[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/vflip.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/fudiao.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorchannelmixer1.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorchannelmixer2.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]drawbox=x=100:y=100:w=iw/2:h=ih/2:c=red[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/drawbox1.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]drawgrid=width=100:height=100:thickness=2:color=black@0.9[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/drawgrid.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorbalance=rs=.3[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorbalance_rs03.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorbalance=bs=.3[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorbalance_bs03.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorbalance=gs=.3[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorbalance_gs03.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorbalance=rm=.3[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorbalance_rm03.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorbalance=bm=.3[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorbalance_bm03.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorbalance=gm=.3[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorbalance_gm03.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorbalance=rh=.3[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorbalance_rh03.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorbalance=bh=.3[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorbalance_bh03.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorbalance=gh=.3[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorbalance_gh03.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorlevels=rimin=0.058:gimin=0.058:bimin=0.058[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorlevels1.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorlevels2.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorlevels=rimax=0.902:gimax=0.902:bimax=0.902[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorlevels3.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]colorlevels=romin=0.5:gomin=0.5:bomin=0.5[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/colorlevels4.mp4
ffmpeg  -v error -framerate 1 -t 10 -loop 1 -i ./test1.png -framerate 1 -t 10 -loop 1 -i ./test1.png   -filter_complex "[0:v]histogram[output];[output]pad=iw*2:ih[output1];[output1][1:v]overlay=w*1[result]"  -map '[result]' -vcodec libx264 -an -y  ./output/histogram.mp4
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 206,126评论 6 481
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 88,254评论 2 382
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 152,445评论 0 341
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 55,185评论 1 278
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 64,178评论 5 371
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,970评论 1 284
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,276评论 3 399
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,927评论 0 259
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 43,400评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,883评论 2 323
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,997评论 1 333
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,646评论 4 322
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,213评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,204评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,423评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,423评论 2 352
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,722评论 2 345