给定一个像这样的 3840x2160 输入分屏视频,长度为 29 分 2 秒
如何将其转换为下面的输出格式?
- 基本上我想向每个玩家展示 1 秒,然后跳到下一个玩家并在整个视频中循环
- 持续时间可以是 1 秒,可以是 2 秒,任何值
我有一个过滤器复杂表达式,它需要 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"
我有 4 个视频,基本上是 4 个人在合作游戏中一起玩。它从同一个过场动画开始,然后显示每个玩家的屏幕。
我试图将它们合并到一个 4 x 4 的网格中,所有视频从一开始就同步(在所有过场动画中),而其余部分通常会继续
我不得不为其中一个视频中的过场动画拍照并搜索此图像以找到每个视频中的偏移量以将它们同步
ffmpeg
-i v_nimble_guardian.mkv -i macko_nimble_guardian.mkv -i ghost_nimble_guardian.mp4 -i nano_nimble_guardian.mkv
-filter_complex "
nullsrc=size=1920x1080 [base];
[0:v] trim=start_pts=59117,setpts=PTS-STARTPTS, scale=960x540 [upperleft];
[1:v] trim=start_pts=60483,setpts=PTS-STARTPTS, scale=960x540 [upperright];
[2:v] trim=start_pts=805117,setpts=PTS-STARTPTS, scale=960x540 [lowerleft];
[3:v] trim=start_pts=48100,setpts=PTS-STARTPTS, scale=960x540 [lowerright];
[base][upperleft] overlay=shortest=1 [tmp1];
[tmp1][upperright] overlay=shortest=1:x=960 [tmp2];
[tmp2][lowerleft] overlay=shortest=1:y=540 [tmp3];
[tmp3][lowerright] overlay=shortest=1:x=960:y=540[v]
"
-map "[v]" -map 1:a -c:v libx264 -shortest output.mkv
一切都完美同步,除了我希望每个视频在 start_pts 帧之前 15 秒开始,我如何指定它?
就像我如何找到 trim=start_pts=some_value 在哪里(你明白了)
some_value = 59117 - 15 seconds
some_value = 805117 - 15 seconds...
我尝试使用以下条目修改 /etc/hosts 文件,但它不起作用。我在 Windows 10 上。我想将下面的重定向到 82
185.38.31.83 185.38.31.82
...84 185.38.31.82
...85 185.38.31.82