justdan96 / tsMuxer

tsMuxer is a transport stream muxer for remuxing/muxing elementary streams, EVO/VOB/MPG, MKV/MKA, MP4/MOV, TS, M2TS to TS to M2TS. Supported video codecs H.264/AVC, H.265/HEVC, VC-1, MPEG2. Supported audio codecs AAC, AC3 / E-AC3(DD+), DTS/ DTS-HD.
Apache License 2.0
849 stars 144 forks source link

SRT subtitles out of sync after demux #621

Closed TheSpider12 closed 2 years ago

TheSpider12 commented 2 years ago

The recent release of tsmuxer fixed the "Can't demux srt subtitles" bug (#616) I reported a few weeks ago but I realize today that the demuxed srt subtitles are out of sync if I reattach it to the original mkv/mp4 movie file and mux it as ts/m2ts. The out of sync issue gets worse as the movie plays. You can try the first episode of Obi-Wan.Kenobi.S01.2160p.DSNP.WEB-DL.DDP5.1.Atmos.DV.MKV.x265-KOGi[rartv]. Movie files that have pgs subtitles do not seem to suffer from this issue.

Edit: I notice that the original fps of the subtitles is 24 fps like the video track. After demuxing, it becomes 23.976 fps. When reattach it to the original video track, the fps is converted from 23.976 to 24 to match the video. Is that the cause of the issue?

Demuxing srt sub from the original file: Capture

Muxing the demuxed srt sub with the original file as ts/m2ts: Capture

jcdr428 commented 2 years ago

@TheSpider it should be fixed in tomorrow's release.

TheSpider12 commented 2 years ago

@TheSpider it should be fixed in tomorrow's release.

Thanks. Is there a way to fix the current ts/m2ts files that have out-of-sync subtitles? I deleted the original mkv/mp4 files so in order to get the non-out-of-sync subtitles with the new version of tsmuxer I will first have to redownload all the original files again, which is quite troublesome.

jcdr428 commented 2 years ago

@TheSpider12 if the original was in 24fps and you demuxed in 23.976fps / remuxed in 24fps, just remux the m2ts with subtitle fps = 24000/1001.

TheSpider12 commented 2 years ago

@TheSpider12 if the original was in 24fps and you demuxed in 23.976fps / remuxed in 24fps, just remux the m2ts with subtitle fps = 24000/1001.

Hmm sorry how do I I remux the m2ts with subtitle fps = 24000/1001? I don't see any option to change the subtitle fps, only video track fps.

jcdr428 commented 2 years ago

@TheSpider12 you have to save the .meta file, edit the sub fps manually in the .meta file, and use the command line tsMuxer.exe file.meta output.m2ts

TheSpider12 commented 2 years ago

@TheSpider12 you have to save the .meta file, edit the sub fps manually in the .meta file, and use the command line tsMuxer.exe file.meta output.m2ts

So I tried this but after I edited the meta file and put 24000/1001 into sub fps, running the command line displayed an error - sth along the line of "the framerate is not standard". So I tried changing it to 23.976 instead and it successfully ran but the output file still has out of sync subtitles.

jcdr428 commented 2 years ago

@TheSpider12 then you have to demux the sup and use a subtitle tool such as bdsup2sub to change its fps.