1

When rendering my animation video with ffmpeg, I want my video to start with 28-odd seconds of silencebefore the soundtrack begins.

(Well, I really want it to be 0.28 seconds but making it longer makes debugging easier.)

That's easy enough. According to the manual and SuperUser and others, it is all about adding the -itsoffset parameter before the audio input you wish to delay.

Here's my command line:

ffmpeg -y -itsoffset 28.84 -i soundtrack.wav -framerate 30 -i %d.png -r 30 -vcodec mpeg4 generated.mp4

It generates the video, but the soundtrack starts immediately.

I am stll new to FFmpeg, so I assume I am missing something obvious.

0
2

You can use the adelay filter for MP4.

ffmpeg -y -i soundtrack.wav -framerate 30 -i %d.png -af "adelay=28840|28840" -r 30 -vcodec mpeg4 generated.mp4
5
1

There is an open ticket against FFmpeg from 4 years ago, that suggests that this is a bug with the mp4 container

2) outfile has expected playback behavior with .ts and .mkv containers.
3) It does not work with .avi (no timestamps, so not a surprise) 4) It does not work with .mp4 container (a bug?)

Sure enough, when I use an mkv file, it works. (Well, in VLC, but no sound at all in the Windows 10 "Films & TV" viewer.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.