Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Subtitles

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th July 2020, 23:44   #1  |  Link
carlosrodriguez
Registered User
 
Join Date: Jun 2020
Posts: 6
ffmpeg creates subtitles delay

Hi everyone

I want to mux a .ass subtitles file into a matroska container together with a video stream.

First I checked the .ass file in Aegisubs before muxing and I got the following timing on the individual subtitles lines:
First text line from 00:14.49 - 00:17.83




If I now mux the .ass file together with a .mkv video file with mkvtoolnix I get the following timing on the first line (through checkingt he resulting .mkv with embedded .ass in Aegisub):
First text line from 00:14.49 - 00:17.83

mkvtoolnix muxed the subtitles file exactly as it was when I checked the .ass file in Aegisub before muxing.



When I tried to mux the .ass file together with a video.mkv file using ffmpeg and the following command, the subtitles timing gets messed up and delayed (through checking the resulting .mkv with embedded .ass in Aegisub):
ffmpeg -i video.mkv -i subtitles.ass -map 0 -map 1 -c copy -output.mkv
First text line from 00:14.44 - 00:17-78




In conclusion: When I mux with ffmpeg instead of mkkvtoolnix, I get delayed subtitles of - 0.05s.

Has anybody else encountered this problem when muxing subtitles with ffmpeg. How can I avoid this and make ffmpeg mux the .ass file exactly as it is shown when opened in Aegisub without creating that 0.05s delay?

Last edited by carlosrodriguez; 11th July 2020 at 14:58.
carlosrodriguez is offline   Reply With Quote
Old 11th July 2020, 22:49   #2  |  Link
carlosrodriguez
Registered User
 
Join Date: Jun 2020
Posts: 6
I found a quick and dirty workaround with itsoffset like this

ffmpeg -i video.mkv -itsoffset 0.05 -i subs.ass -c copy output.mkv

It seems to work but it is still somewhat problematic because I don't know if the subtitles offset is always 0.05s and always in the same direction. I am muxing wiith .bat batch files and if I have to test every single file again for the delay I could just as well mux them one by one in mkvtoolnix. The whole point of me doing it in ffmpeg command line is that I can automate it with batch.

Would still appreciate it if somebody knows why this delay happens in the first place and if there is any command that prevents it. Must be something with timestamps or key frames or the sorts. I have no experience with these things unfortunately.
carlosrodriguez is offline   Reply With Quote
Old 12th July 2020, 09:57   #3  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,550
Quote:
Originally Posted by carlosrodriguez View Post
I am muxing wiith .bat batch files and if I have to test every single file again for the delay I could just as well mux them one by one in mkvtoolnix. The whole point of me doing it in ffmpeg command line is that I can automate it with batch.
MKVToolNix includes "mkvmerge" which is a cli tool like ffmpeg.
Code:
mkvmerge -o "output.mkv" "video.mkv" "subs.ass"
https://mkvtoolnix.download/doc/mkvmerge.html
sneaker_ger is offline   Reply With Quote
Old 12th July 2020, 12:54   #4  |  Link
carlosrodriguez
Registered User
 
Join Date: Jun 2020
Posts: 6
Thank you sneaker_ger I didn't think of that. I will use this method from now on with the option of .bat files and without having to deal with the delay.
carlosrodriguez is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:46.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.