{"action":"created","issue":{"url":"https://api.github.com/repos/mbunkus/mkvtoolnix/issues/1442","labels_url":"https://api.github.com/repos/mbunkus/mkvtoolnix/issues/1442/labels{/name}","comments_url":"https://api.github.com/repos/mbunkus/mkvtoolnix/issues/1442/comments","events_url":"https://api.github.com/repos/mbunkus/mkvtoolnix/issues/1442/events","html_url":"https://github.com/mbunkus/mkvtoolnix/issues/1442","id":107844399,"number":1442,"title":"mkvmerge does not split subtitles by time as expected","user":{"login":"fingershop","id":305374,"avatar_url":"https://avatars.githubusercontent.com/u/305374?v=3","gravatar_id":"","url":"https://api.github.com/users/fingershop","html_url":"https://github.com/fingershop","followers_url":"https://api.github.com/users/fingershop/followers","following_url":"https://api.github.com/users/fingershop/following{/other_user}","gists_url":"https://api.github.com/users/fingershop/gists{/gist_id}","starred_url":"https://api.github.com/users/fingershop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fingershop/subscriptions","organizations_url":"https://api.github.com/users/fingershop/orgs","repos_url":"https://api.github.com/users/fingershop/repos","events_url":"https://api.github.com/users/fingershop/events{/privacy}","received_events_url":"https://api.github.com/users/fingershop/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mbunkus/mkvtoolnix/labels/app:mkvmerge","name":"app:mkvmerge","color":"fbca04"},{"url":"https://api.github.com/repos/mbunkus/mkvtoolnix/labels/type:bug","name":"type:bug","color":"fc2929"},{"url":"https://api.github.com/repos/mbunkus/mkvtoolnix/labels/v8.4.0","name":"v8.4.0","color":"330099"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-23T03:46:22Z","updated_at":"2015-10-03T16:26:14Z","closed_at":"2015-10-03T16:26:14Z","body":"When splitting segments from a single original mkv file (with AVC, AC3, & SRT) the subtitles are being split in an unexpected fashion, which when the segments are joined together again results in large audio sync issues, and possibly other issues. Using v8.4.0 32bit on XPsp3.\r\n\r\nHere's a more detailed description of the issue:\r\n\r\nWhen a subtitle's display duration goes past the end time of a split segment, I expected that the subtitle's display duration would get truncated as needed, but instead the entire duration is preserved in the segment.\r\n\r\nWhen joining such segments with a bunch of other related segments, this results in equivalent time offsets in the audio tracks, and also causes chapters to seek to the wrong position.\r\n\r\nAs a test, if I don't include the subtitle track at all during the split, then joining the segments works normally.\r\n\r\nI uploaded a file called sj-source.mkv, and you can duplicate the issue with these commands:\r\nmkvmerge.exe -o split.mkv sj-source.mkv --split timecodes:00:00:01,00:00:10.2\r\nmkvmerge.exe -o join.mkv --default-duration 0:24000/1001p split-001.mkv + split-003.mkv\r\n\r\nIf you listen to join.mkv, you'll see that the sound of the man thumping the mask on his knee is being delayed, and also that the last few seconds of audio were truncated by the same amount.\r\n\r\nIf you extract the subs from the split-001.mkv and split-002.mkv files, you can see that the 001 sub is over 2.7s long, but it should only be 1s long, same as the video in that segment. Also, you'd expect the 001 sub to continue into the 002 segment, but it doesn't, leaving no subs for the start of that segment. (btw, i've included the english ac3 track instead of the japanese one, which is where the eng subs would normally be needed)\r\n\r\nEdit: Forgot to mention, if you re-join the 3 segments in their original order, the same issues are also present.\r\n\r\nLet me know if you need any more info, and thanks!"},"comment":{"url":"https://api.github.com/repos/mbunkus/mkvtoolnix/issues/comments/145262952","html_url":"https://github.com/mbunkus/mkvtoolnix/issues/1442#issuecomment-145262952","issue_url":"https://api.github.com/repos/mbunkus/mkvtoolnix/issues/1442","id":145262952,"user":{"login":"mbunkus","id":414282,"avatar_url":"https://avatars.githubusercontent.com/u/414282?v=3","gravatar_id":"","url":"https://api.github.com/users/mbunkus","html_url":"https://github.com/mbunkus","followers_url":"https://api.github.com/users/mbunkus/followers","following_url":"https://api.github.com/users/mbunkus/following{/other_user}","gists_url":"https://api.github.com/users/mbunkus/gists{/gist_id}","starred_url":"https://api.github.com/users/mbunkus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbunkus/subscriptions","organizations_url":"https://api.github.com/users/mbunkus/orgs","repos_url":"https://api.github.com/users/mbunkus/repos","events_url":"https://api.github.com/users/mbunkus/events{/privacy}","received_events_url":"https://api.github.com/users/mbunkus/received_events","type":"User","site_admin":false},"created_at":"2015-10-03T16:26:14Z","updated_at":"2015-10-03T16:26:14Z","body":"After thinking some more about it I've decided not to work on this and to leave it as it is right now. Apart from the technical difficulties of implementing such functionality there's also the question which kind of behavior would actually be better.\r\n\r\nWhenever splitting is involved I always have to think about its reversal: appending the split-up files again. And here's where it gets really complicated for subtitles.\r\n\r\n1. If I cut the subtitle's duration at the split point then appending two resulting files will result in an entry that's too short. Additionally the second part of the split doesn't contain the subtitle entry at all.\r\n2. If I decide to split the subtitle entry's duration and re-create the part in the second part of the split then appending them again results in two subtitle entries which might flicker on screen. One could imagine some kind of detection whether such two entries are the result of splitting and merging them back into a single entry, but that process is fragile and would break with almost any modification of one of the split parts (e.g. delaying the track in the second part). On top of that it's not so easy to split subtitles. For text subs this is trivial, but for bitmap subs this may be more involved again adding to the amount of work required to implement this properly.\r\n\r\nSorry.\r\n"}}