How to build a slideshow video from images and a voiceover with an API
The slow part of a templated video ad is not the render, it is syncing the voiceover to the slides. Setting a duration per image in a template means redoing it whenever the script changes. Letting the transcript decide the durations removes that loop, and it means one template per aspect ratio instead of one per job.
The manual FFmpeg way
One command per slide, then a second pass to join them, then a third for the audio and a fourth for the captions. Each re-encode costs quality, and the durations are still guessed by hand.
ffmpeg -loop 1 -i slide1.png -t 6 -vf "scale=1080:1920,format=yuv420p" slide1.mp4
Do it with one API call
- 1
Transcribe the voiceover first
Send the narration to transcribe-video. The segments come back with start and end times, which is what tells you how long each paragraph takes to read.
- 2
Turn each image into a clip of that length
Call image-to-video per image with the duration its paragraph occupies and the aspect ratio you are producing. Add the job text and branding in the same job with an add_text operation through create_video_job.
- 3
Join, lay the voice, burn the captions
merge-videos joins the clips with a crossfade, add-music-to-video lays the narration over the result, and add-subtitles-to-video burns the SRT the transcription already produced, so the captions are in sync by construction.
- 4
Declining to other formats
Run format-video-for-platform or resize-video on the finished cut. This is the last and cheapest step, and it is the only one you repeat per format.
curl https://kinopipe.com/api/v1/tools/image-to-video \
-H "Authorization: Bearer kp_live_..." \
-H "Content-Type: application/json" \
-d '{
"inputs": [
{ "id": "main", "url": "https://example.com/slide-1.png" }
],
"options": { "duration": 6.4, "aspect_ratio": "9:16" }
}'FAQ
Why time the slides from the transcript instead of the template?
Because the script changes more often than the design. When the durations come from the narration, a rewritten paragraph re-times its own slide and nothing else has to be touched.
Can the text and the logo go on in the same pass?
Yes. create_video_job accepts an add_text operation with a position, size, colour and a boxed or outlined style, and a watermark composition, so the overlay happens in the same FFmpeg pass as the rest.
How many formats can I produce from one cut?
As many as you need. Resizing a finished cut is a single fast operation, which is why the aspect ratio is the last decision rather than the first.