将循环视频添加到声音ffmpeg [英] Adding loop video to sound ffmpeg

查看:62
本文介绍了将循环视频添加到声音ffmpeg的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用ffmpeg,这是我的第一个疑问:

i start working with ffmpeg, and here my first doubt:

我有一个声音文件,例如example.mp3(持续1分钟).我要添加一个循环视频example.mp4(持续时间为x秒).

I have one sound file, example.mp3 (1 min duration). I want add a loop video, example.mp4 ( x sec duration).

在这种情况下,我想生成1分钟的mp4视频并将此视频循环播放3次,但这可能是动态的.

I want generate 1 min mp4 video and loop this video 3 times in this case, but this could be dynamic.

可以用ffmpeg做到吗?

Its posible do this with ffmpeg ?

预先感谢

推荐答案

您可以使用

ffmpeg -i audio.mp3 -filter_complex movie=video.mp4:loop=0,setpts=N/FRAME_RATE/TB -shortest out.mp4

由于最短的现有错误,输出将比音频更长.

Due to a existing bug in shortest, output will be somewhat longer than the audio.

这篇关于将循环视频添加到声音ffmpeg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆