Hi i want to make a video using images. Lets say i have an audio of 60 seconds and 6 images and i want my video to show images with equal durations i.e 10 second per image but i couldn't figure it out how to do it here is my code
import ffmpeg
input_audio = ffmpeg.input('./SARS/SARS.mp3')
input_still = ffmpeg.input('./SARS/*.jpg',t=20, pattern_type='glob', framerate=24)
(
ffmpeg
.concat(input_still, input_audio, v=1, a=1)
.filter('scale', size='hd1080', force_original_aspect_ratio='increase')
.output('./SARS/output.mp4')
.run(overwrite_output=True)
)
any help is appriciated
I'm sure you can achieve this with
ffmpeg-python
but you can try one of the following:Plain CLI
You can run this in Python using
subprocess.run(['ffmpeg','-y',...])
ffmpegio
PackageFor a one-time pure transcoding need,
ffmpegio
is actually an overkill and directly callingffmpeg
viasubprocess
is more than sufficient and faster, but if you do this kind of operations often you can give it a try.Essentially, it's like
subprocess
counterpart but takes a dict of parameters.