我有一个过滤器复杂表达式,它需要 4 个输入视频并将它们组合在屏幕的 4 个角落,并在每个视频的特定开始时间同步
ffmpeg \
-i first_vid.mkv \
-i second_vid.mp4 \
-i third_vid.mkv \
-i fourth_vid.mkv \
-filter_complex \
"nullsrc=size=1280x720 [base]; \
[0:v] \
trim=start=40,\
setpts=PTS-STARTPTS,\
scale=640x360,\
drawtext=fontfile=/Users/vr/Downloads/gameplay_vids/generated/control-freak-font/CONTF___.ttf\
:text='one'\
:fontsize=32\
:fontcolor=0xFFFFFF\
:alpha='if(lt(t,30),0,if(lt(t,35),(t-30)/5,if(lt(t,65),1,if(lt(t,70),(5-(t-65))/5,0))))'\
:x=w-text_w-12\
:y=h-text_h-12 [upperleft];\
[1:v] \
trim=start=35.05, \
setpts=PTS-STARTPTS, \
scale=640x360, \
drawtext=fontfile=/Users/vr/Downloads/gameplay_vids/generated/control-freak-font/CONTF___.ttf \
:text='two' \
:fontsize=32 \
:fontcolor=0xFFFFFF \
:alpha='if(lt(t,30),0,if(lt(t,35),(t-30)/5,if(lt(t,65),1,if(lt(t,70),(5-(t-65))/5,0))))' \
:x=w-text_w-12 \
:y=h-text_h-12 [upperright]; \
[2:v] \
trim=start=36.467, \
setpts=PTS-STARTPTS, \
scale=640x360, \
drawtext=fontfile=/Users/vr/Downloads/gameplay_vids/generated/control-freak-font/CONTF___.ttf \
:text='three' \
:fontsize=32 \
:fontcolor=0xFFFFFF \
:alpha='if(lt(t,30),0,if(lt(t,35),(t-30)/5,if(lt(t,65),1,if(lt(t,70),(5-(t-65))/5,0))))' \
:x=w-text_w-12 \
:y=h-text_h-12 [lowerleft]; \
[3:v] \
trim=start=35.097, \
setpts=PTS-STARTPTS, \
scale=640x360, \
drawtext=fontfile=/Users/vr/Downloads/gameplay_vids/generated/control-freak-font/CONTF___.ttf \
:text='four' \
:fontsize=32 \
:fontcolor=0xFFFFFF \
:alpha='if(lt(t,30),0,if(lt(t,35),(t-30)/5,if(lt(t,65),1,if(lt(t,70),(5-(t-65))/5,0))))' \
:x=w-text_w-12 \
:y=h-text_h-12 [lowerright]; \
[2:a] \
atrim=start=36.467, \
asetpts=PTS-STARTPTS[outa]; \
[base][upperleft] overlay=shortest=1 [tmp1]; \
[tmp1][upperright] overlay=shortest=1:x=640 \
[tmp2];[tmp2][lowerleft] overlay=shortest=1:y=360 \
[tmp3];[tmp3][lowerright] overlay=shortest=1:x=640:y=360[v] \
" -map "[v]" -map "[outa]" -c:v libx264 -shortest -ss 00:00 -to 9999 "output.mp4"
- 我想删除输出视频 37:23 到 37:33 之间的部分
- 有没有办法可以做到这一点,而无需编写单独的 ffmpeg 命令(如管道、链或多个 filter_complex 表达式)?
要修剪指定部分,您需要分割、修剪,然后连接这些片段。
然后后来,