我正在使用以下内容裁剪视频并为视频添加字幕:
ffmpeg -i inputfile.mov -lavfi "crop=720:720:280:360,subtitles=subs.srt:force_style='OutlineColour=&H100000000,BorderStyle=3,Outline=1,Shadow=0,MarginV=20,Fontsize=18'" -crf 1 -c:a copy output.mov
我还有一个名为credits.mp4的视频,其尺寸与output.mov相同(裁剪后)。我可以在上述过程中执行此操作,还是在此后使用concat之类的方法?
在Mac上的Terminal中使用bash
ffmpeg -i inputfile.mov -i credits.mp4 -lavfi "[0]crop=720:720:280:360,subtitles=subs.srt:force_style='OutlineColour=&H100000000,BorderStyle=3,Outline=1,Shadow=0,MarginV=20,Fontsize=18',setpts=PTS-STARTPTS[v0];[1]setpts=PTS-STARTPTS[v1];[v0][0:a][v1][1:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" output.mp4
因为没有提供有关您输入的信息,所以我作了一些假设:
credits.mp4
有音频。如果不是,则添加音频文件或使用anullsrc filter as an input to create silent/dummy/filler audio进行适当的串联。