function ntob($nNum) {
[BitConverter]::ToString($nNum)
}
$colorkey = "#$(ntob 0)$(ntob 255)$(ntob 0)"
start -WindowStyle Minimized ffplay -arg "-i src1.mp4 -noborder -vf scale=640:-1 -left 0 -top 0 -noborder -alwaysontop"
start -WindowStyle Minimized ffplay -arg "-i src2.mp4 -noborder -vf scale=640:-1 -left 640 -top 0 -noborder -alwaysontop"
$strParames = "-i src1.mp4 "
$strParames += "-i src2.mp4 "
$strParames += "-filter_complex [1:v]colorkey=$($colorkey):0.41:0.01,crop=720:720:0:0[mask];[0][mask]overlay[out] "
$strParames += "-map [out] "
$strParames += "-map 0:1 "
$strParames += "-vcodec h264_nvenc "
$strParames += "-acodec aac "
$strParames += "-ar 16000 "
$strParames += "-f mpegts "
$strParames += "pipe:"
Invoke-NativeCommand ffmpeg -arg $strParames.Split(" ") | Invoke-NativeCommand ffplay -arg "-i pipe: -noborder -alwaysontop -left 0 -top 360".Split(" ") | Receive-RawPipeline
注意
1. colorkey filter用详细用法
2. powershell中管道解析的坑(第三方解决方案Use-RawPipeLine)