Skip to content

Conversation

@cyu098723
Copy link

Problem Summary

Cause:
After a subtitle was converted/renamed to .srt, the TextTrack object continued to point (self._location) to the original path ending in .mp4. When muxing, mkvmerge received the .mp4 path (which didn't exist) and failed with an "open file error."
Example of the error you showed: mkvmerge tried to open ~/VT-PR/Temp/TextTrack_en-us_subtitle_dialog_0_dec.mp4 but the subtitle was actually in .srt format.

Fixes:
Update self._location when the file is renamed to .srt.
When converting formats (when self.codec != "srt"), I now explicitly write the SRT to a file with the .srt extension, remove the original container file, and update self._location to point to the .srt file.
I kept the behavior of returning the actual path of the final file (now returns .srt when applicable).

How is this the case?
After the fix, TextTrack._location now points to TextTrack_... .srt. In the mux step, Tracks.mux() calls st.locate() and gets the correct .srt path, so mkvmerge won't try to open a non-existent .mp4.

Fix these issues: #144 #162 #182

@chu23465
Copy link
Owner

You have tested this fix right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants