How can I fix delayed subtitles in videos?

55,117

Solution 1

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.

Solution 2

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.

Share:
55,117

Related videos on Youtube

user168459
Author by

user168459

Updated on September 18, 2022

Comments

  • user168459
    user168459 almost 2 years

    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?

    • Admin
      Admin over 11 years
      If the subtitles are already in the video stream, as opposed to coming from an external ST file, you're out of luck.
    • slhck
      slhck over 11 years
      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?
    • Biswapriyo
      Biswapriyo almost 7 years
      See this VLC article about subtitle delaying.
  • jtgd
    jtgd over 6 years
    This also works for just adjusting an SRT file, in and out.
  • Mr. Tao
    Mr. Tao about 6 years
    @jtgd indeed ffmpeg -itsoffset 0.7 -i original.vtt adjusted.srt just works!
  • raine
    raine over 3 years
    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