r/ffmpeg • u/Elegant-Contract-568 • 11h ago
HELP > Batch Creating Still Image Videos Timed to Varying Length Audio Files...?
hey all!
i'm a total beginner when it comes to FFMPEG so i'm hoping this is solvable by someone with more experience?
PROBLEM:
i have a bunch of audio at variable lengths, and i have a bunch of pictures that belong to the audio. one picture (PNG files) will belong to variable audio files (sometimes 5 sometimes 100).
i'd like to output X video files (H.264, mp4s, 1920x1080 at whatever framerate ((1fps is perfectly fine!))) that display the still image and are timed to each individual audio file's length.
so if i put in 1 image for 2 audio files, (first at 30seconds and second at 90 seconds), i want two video files with the same static image — but the first output with the audio of the first file (and timed to 30seconds – the audio file's length), and the second output with the audio of the second file (and timed to 90seconds – the audio file's length).
CURRENT SITUATION:
i've used the FFMPEG explorer to create this for single file processing:ffmpeg -i 01.png -i 01 001 Intro Credits.flac -filter_complex "[0:v]fps=fps=1[out_v];[1:a]aresample=sample_rate=48000[out_a]" -map "[out_a]" -map "[out_v]" out.mp4
this has generated half-working videos that, after being encoded by Shutter Encoder or similar, turn into fully working videos.
i've experimented with some requests i've written down below but almost anything i've done has broken it... so i must be doing something wrong
REQUEST:
what i'd like to add to this is:
- correct the output to be a working video, directly (rather than going through another encoding pass)
- allow for a list of audio files to be inputted, to iterate through
- control the output location
eventually, i want to set this up as a watch folder — which i understand i can do through Shutter Encoder (planning to tackle that once all this is solved)
thank you so much in advance!!! would love to learn more through this project of how FFMPEG works and all, also!