You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
stitchFramesToVideo: -shortest cuts the video when the audio ends before the last frame #19
When the audio in a composition ends before the last frame (a silent outro, or narration that finishes a bit early), the rendered MP4 is cut to the length of the audio and the remaining frames are lost. In our project a 54.4 s composition came out at 52.1 s.
Small repro, with a.mp3 being any 2 second clip (I used ffmpeg -f lavfi -i "sine=frequency=440:duration=2:sample_rate=24000" -ac 1 a.mp3):
It comes from the -shortest flag in stitch-frames-to-video.ts. It's there so audio can't make the video longer, but it also stops the output as soon as the audio ends.
You can also see the audio stays at 24 kHz, the rate of the source MP3s (TTS output is often 24 kHz), even with -b:a 192k.
What worked for me was padding the mix with apad and limiting the output with -t <frames / fps> instead of -shortest, plus -ar 48000 on the audio encoder. With that the same repro gives 5 s of video and 5 s of 48 kHz audio. I've put it in #26 in case it's useful.
Activity