简体   繁体   English

FFmpeg 并排视频(宽屏)并逐个播放每个视频

[英]FFmpeg side by side video (widescreen) and play each video one by one

new to ffmpeg, I've already did this to combine 3 or more videos that I have into 1 video: ffmpeg 的新手,我已经这样做了将我拥有的 3 个或更多视频合并为 1 个视频:

ffmpeg -i left.mp4 -i center.mp4 -i right.mp4 -filter_complex "[0:v:0][1:v:0][2:v:0]hstack=inputs=3" -c:v libx264 -tune film -crf 16 -b:a 256k output.mp4

Now what I am having trouble with is the videos have different play times (in seconds) what I want to achieve is have them all side by side (working with the code above) then have left.mp4 play first (with it's own audio) once done, center.mp4 plays (has own audio), and when done too, right.mp4 plays (has own audio) as well and the video is over.现在我遇到的问题是视频有不同的播放时间(以秒为单位)我想要实现的是让它们并排(使用上面的代码)然后让 left.mp4 先播放(使用它自己的音频)完成后,center.mp4 播放(有自己的音频),完成后,right.mp4 也播放(有自己的音频),视频结束。

Can someone enlighten me on how to achieve this?有人可以启发我如何实现这一目标吗? Thank you!谢谢!

Add the tpad and concat filters.添加tpadconcat过滤器。 Example where each input is 10 seconds long:每个输入长度为 10 秒的示例:

ffmpeg -i left.mp4 -i center.mp4 -i right.mp4 -filter_complex "[1:v]tpad=start_duration=10:start_mode=clone[v1];[2:v]tpad=start_duration=20:start_mode=clone[v2];[0:v:0][v1][v2]hstack=inputs=3,format=yuv420p[v];[0:a][1:a][2:a]concat=n=3:v=0:a=1[a]" -map "[v]" -map "[a]" -c:v libx264 -tune film -crf 16 -b:a 256k -movflags +faststart output.mp4

This will freeze frame the first frame of each video until it begins.这将冻结每个视频的第一帧,直到它开始。 If you want a solid color instead change start_mode=clone to start_mode=add .如果您想要纯色, start_mode=clone更改为start_mode=add

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 linphone 3.5.2中的一侧视频(适用于Android) - one side video in linphone 3.5.2 for android 并排水平显示两个视频并导出为一个视频 - Horizontally show two videos side by side and export to one video 我怎样才能在 FFMPEG 中加速这个并排视频拼接 - How can I speed up this side by side video stitch in FFMPEG 通过音频(FFMPEG 或类似的)编码并排视频同步 - Encode Side by Side Video Sync'd by Audio (FFMPEG or similar) FFmpeg - 将一个视频叠加到另一个视频上? - FFmpeg - Overlay one video onto another video? FFmpeg:将任何视频转换为具有模糊边条的方形 1:1 视频 - FFmpeg: convert any video to square 1:1 video with blurred side bars 将两个div居中放置在html5视频顶部并居中,其中一个带有徽标,另一个带有文本。 - Centre two divs, one with a logo and one with text, side by side on top of a html5 video and still be responsive? iOS像Homido App一样并排播放同一视频 - iOS Play Same Video Side by Side like Homido App 宽屏上宽度为100%的视频 - video with 100% width on a widescreen FFMPEG-将多个视频合并到一个视频中,输出视频没有音频 - FFMPEG - Merge multiple video in to one video, the output video has no audio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM