3

I have been trying to get lots of wav files delayed by 2 seconds at the start using ffmpeg. And so far, even though I have read the manual, I was not able to get it working. Here is my command:

for %%A in (*.wav) do (
ffmpeg -i "%%A" -itsoffset 00:00:02 "%%~NA"1.wav )

And nothing is being changed. Files are simply getting copied. I also tried the same with mp3 files. I also tried mkv and avi (to make sure it was not a container writing issue), but it gives the same result also.

Command is same here and here, but it does not work. Please, help.

| improve this question | |
4
0

You must put -itsoffset BEFORE you specify input. So:

ffmpeg -itsoffset 00:00:02 -i "%%A" "%%~NA"1.wav
| improve this answer | |
2
0

Changing the input time offset like that isn't going to do anything noticeable for a single stream, it's meant for fixing out-of-sync issues between audio and video streams.

Do you want to tack on two seconds of silence at the start? If so, one simple way that'd work (although it may feel a bit hackish) is to simply tack on a 2 second WAV full of silence, before the actual input. This would be accomplished by simply adding another -i option before the actual file:

ffmpeg -i 2secsilence.wav -i "%%A" "%%~NA"1.wav
| improve this answer | |
2
0

I know this question is over 9 months old, but I came across it and wanted to add some more information about '-itsoffset'. From the ffmpeg trouble ticket pages (https://ffmpeg.org/trac/ffmpeg/ticket/1349):

This command should display file1 content one second earlier than file2 content:

ffmpeg -itsoffset -1 -i file1.ts -i file2.ts -vcodec copy -acodec copy -map 0:0 -map 1:1 out.ts

1) What I see is that -itsoffset adds or subtracts from all the timestamps (both the video and audio streams) in a file. So this option is only going to be useful when remuxing from separate input files.

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?)

And that is where this issue stands as of today.

| improve this answer | |

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.