7

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?

3
  • 1
    If the subtitles are already in the video stream, as opposed to coming from an external ST file, you're out of luck.
    – user3463
    Oct 28, 2012 at 19:28
  • 4
    It would help to clarify if the subtitles are hardcoded, multiplexed in the video file (MKV or MP4, etc.), or if they're in a separate .srt file. Also, have you tried a subtitle editor already?
    – slhck
    Oct 28, 2012 at 19:31
  • See this VLC article about subtitle delaying.
    – Biswapriyo
    Aug 20, 2017 at 3:40

2 Answers 2

19

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.

3
  • 1
    This also works for just adjusting an SRT file, in and out.
    – jtgd
    Nov 25, 2017 at 11:06
  • 5
    @jtgd indeed ffmpeg -itsoffset 0.7 -i original.vtt adjusted.srt just works!
    – Mr. Tao
    Apr 18, 2018 at 17:54
  • I got following error: "Invalid UTF-8 in decoded subtitles text; maybe missing -sub_charenc option" and had to do ffmpeg -itsoffset 0.7 -sub_charenc ISO8859-1 -i sub.srt adjusted.srt
    – raine
    Feb 20, 2021 at 18:00
6

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .