News:

--

Main Menu

Issues with syncing subtitles

Started by diana0325, December 27, 2020, 04:08:58 AM

Previous topic - Next topic

diana0325

Hi, I have a problem with my subtitles (ass file), I use aegisub to sync them and they look perfectly fine on aegi but when I'm attempting to encode them, already on the preview they look slightly out of sync and I don't undestand why. I installed the 201213 version from this link https://avidemux.org/nightly/vsWin64/ as I was having trouble with some fonts and I read that version was the proper one (and it worked for that). The sync problem seems to be that they are appearing early, but then to see what happened, I tried tweaking a bit with the timing in aegi and it doesn't matter how I change the starting and ending times while it fixes in some parts in others it's still messed up. The difference is minimal, almost barely noticeable, but it still bothers me and I don't understand how or why it happens. Is this a bug? Can I fix it?

eumagga0x2a

I can easily imagine that Aegisub and Avidemux disagree for the amount of B-frame delay as Avidemux uses unsigned values for timestamps and therefore the first few decode timestamps (DTS) cannot become negative to allow the first presentation timestamp (PTS) being equal zero despite B-frames present.

It may be even more complicated when video stream has an open GOP structure and has been cut (portions within the stream deleted or copypasted) with Avidemux. Avidemux may have to increase delay to account for early B-frames when later pictures in the GOP depend on them and the early B-frames cannot be dropped. In such a case, the delay may vary at every cut point. However, as you probably add subtitles after the video has been cut with Avidemux, this should not matter.

You might try adding a delay in Aegisub equal the PTS of the first frame in Avidemux for each video where you are going to hardcode subtitles.

diana0325

Thank you for answering, I honestly don't know much about the technical part of all this, but I think I understood some parts of your message. For instance for the video I was trying to hardsub when I open it on avidemux it shows a .016 delay but I can't delay the subs like that on aegi, I can only do .01 / .02, so in that case there is nothing I can do?

I don't fully understand the part about "add subtitles after the video has been cut with Avidemux". For this video I just downloaded it from youtube and started working on the subs on aegi and then I tried to encode. Should I be doing something on avi before doing the subs on aegi?

eumagga0x2a

Quote from: diana0325 on December 27, 2020, 10:13:40 PMFor instance for the video I was trying to hardsub when I open it on avidemux it shows a .016 delay but I can't delay the subs like that on aegi, I can only do .01 / .02, so in that case there is nothing I can do?

The precision is limited to 1/100 sec (10 ms), yes, but time shift is not limited to 20 ms according to http://docs.aegisub.org/manual/Shift_Times. 16 ms (or rather 17 ms when rounded up) first frame delay in Avidemux indicates that the video has frame rate of 60 fps with one frame worth of B-frame delay. I would create subtitles in Aegisub to keep them in sync in Aegisub until the whole video is done, then shift all the subtitles by 1 frame before hardcoding them.

Alternatively, you could fetch a version of the video encoded with VP9. Contrary to H.264 (AVC1), VP9 doesn't use frame reordering = no B-frames = no disagreement in timing between Aegisub and Avidemux. If you still experience bad sync even with VP9 videos, then the nature of the problem must be different and we'd need to investigate deeper.

Quote from: diana0325 on December 27, 2020, 10:13:40 PMShould I be doing something on avi before doing the subs on aegi?

No. I meant a scenario of deleting a part of a video not at the start or at the end and saving the result in copy mode in Avidemux. The total duration of the output may deviate from the original total duration with the duration of the deleted part subtracted. If there was already a subtitle file for the original file, simply shifting all subs past the cut point by the duration of the deleted portion may produce an offset of a few frames for the subtitles.

This scenario doesn't apply here, so please just ignore it.