I have subtitles that are already coded into a video, but which are delayed by 700ms.
I have about 50 episodes of a show and it's getting annoying to have to set the subtitle delay in VLC everytime I want to watch it.
How can I fix these videos?
Only a few years late but:
This works for non-hardcoded (non-burned) subs, so embedded srt, ass, and the like.
ffmpeg -i input.mp4 -itsoffset -0.7 -i input.mp4 -map 0:v -map 0:a -map 1:s -c copy output.mp4
This command uses the same file for input twice, but using -itsoffset -0.7
tells it to offset the timestamps on the following input by -0.7 seconds. The map commands then tell it to grab the video and audio from the 0th input that doesn't have a delay, and grab the subtitle track from the 1st input which is offset.
ffmpeg -itsoffset 0.7 -i original.vtt adjusted.srt
just works!
ffmpeg -itsoffset 0.7 -sub_charenc ISO8859-1 -i sub.srt adjusted.srt
If you're getting the subtitles from a separate file (ending in .srt
) then the easiest way is to paste them into this website, change the delay on the right hand side and press "Simple delay" to download a new subtitle file.
If you absolutely must use a program (rather than a website) then this page has a list of software (for Windows, OS X and Linux) which will not only delay subtitles but do many other useful things. There is also a Super User question asking what the best subtitle editor is.
If the subtitles are already baked into the video, then there is nothing you can do. However since you mention that you're able to change the delay in VLC, then it would suggest that you are using a separate subtitle file.
.srt
file. Also, have you tried a subtitle editor already?