gpt4 book ai didi

android - 如何使用 ffmpeg 并排创建两个带有填充和图像背景的视频?

转载 作者:太空宇宙 更新时间:2023-11-03 13:07:30 24 4
gpt4 key购买 nike

使用 ffmpeg 使用 collageView 同时播放两个视频。我有代码,但它不能正常工作,请帮助我。

-ss " + getStartTime()  + durationTime_act_select +getVideoUrl() +
" -ss " + getStartTime() +
" -t " + this.durationTime_act_select +
" -i " + getVideoUrl() +
" -i " + "R.jpg" +
" -filter_complex nullsrc=size=720*720[base1];" +
"[0:v]setpts=PTS-STARTPTS,scale=345*700[upperleft];" +
"[1:v]setpts=PTS-STARTPTS,scale=345*700[upperright];" +
"[2:v]setpts=PTS-STARTPTS,scale=720*720[over];" +
"[base1][over]overlay=shortest=1:x=0:y=0[base];"+
"[base][upperleft]overlay=shortest=1:x=10:y=10[tmp1];" +
"[tmp1][upperright]overlay=shortest=1:x=366:y=10" +
" -c:a copy -strict experimental -ss 0 -t " + this.durationTime_act_select + " -preset ultrafast -an " +videoName_act_select

enter image description here

最佳答案

根据您的要求

array2 = (FileUtils.getFFmpeg(SelectedFrameVideos.this) +
" -y -ss " + ((Collage) Utils.collageData.get(0)).getStartTime() +
" -t " + String.valueOf(this.durationTime_act_select) +
" -i " + ((Collage) Utils.collageData.get(0)).getVideoUrl() +
" -ss " + ((Collage) Utils.collageData.get(1)).getStartTime()+
" -t " + String.valueOf(this.durationTime_act_select) +
" -i " + ((Collage) Utils.collageData.get(1)).getVideoUrl() +
" -i " + "/storage/emulated/0/R.jpg" +
" -filter_complex nullsrc=size=720*720[base];" +
"[base][2:v]overlay=1,format=yuv420p[base1];"
"[0:v]setpts=PTS-STARTPTS,scale=345*700[upperleft];" +
"[1:v]setpts=PTS-STARTPTS,scale=345*700[upperright];" +
"[base1][upperleft]overlay=shortest=1:x=10:y=10[tmp1];" +
"[tmp1][upperright]overlay=shortest=1:x=366:y=10" +
" -c:a copy -strict experimental -ss 0 -t " + String.valueOf(this.durationTime_act_select) + " -preset ultrafast -an " +
SelectedFrameVideos.this.videoName_act_select).split(" ");

并排添加两个视频并添加显示在视频上的叠加图像填充您可以在此处更改背景图像“-i”+“/storage/emulated/0/R.jpg”设置背景图像路径

在视频下方显示此命令创建的视频

enter image description here

关于android - 如何使用 ffmpeg 并排创建两个带有填充和图像背景的视频?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56274700/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com