Extracting/demultiplexing subtitles embedded in OpenDML AVI files
- 1. Problem
- 2. Research
- 3. Solution
- 3.1. Use a hand-made demultiplexer
- 3.2. Use AVI-Mux GUI
1. Problem
I happened to come across AVI files which supposedly have soft subs embedded, but haven’t been able to make MPlayer display the subs. The audio and video play fine, however.
2. Research
OpenDML AVI files are AVI files with the specs extended to accomodate certain improvements, such as bigger files. However, the specs have been pushed to the limit in order to also accomodate the insertion of embedded soft subs in these files. It is considered an abomination by some people, so while MPlayer will play audio and video tracks from such files just fine, the makers refuse to implement functionality that will render the embedded subs.
Here’s a MPlayer-users thread which discusses the problem.
At the time of writing, AVI-Mux
GUI seems to be the only tool that embeds subtitles in these AVI files.
3. Solution
3.1. Use a hand-made demultiplexer
As detailed later
in that thread, here are a shell script and C source files for creating a tool that will demultiplex these AVI files and create MKV (Matroska) files out of them instead.
You need to compile the binary utility and then use the shell script in the same directory with the binary. Sorry, no more instructions. You either already know what to do with them, or you don’t. Any halfway instructions on my part would probably only lead to trouble.
Not to worry, I’ve edited the shell script so it won’t delete the original AVI file anymore.
3.2. Use AVI-Mux GUI
In case you aren’t the type that can make sense of the above script and source, here’s an alternative tip: AVI-Mux GUI (link above) seems to run acceptably well under Windows emulators.
However, the exact emulator it will run under varies. For me it worked under Wine, but under Cedega or Win4Lin it loaded the files with their last letter missing (ie. file.av instead of file.avi), so AVI-Mux complained that they aren’t in the supported extension list and won’t process them.
So run it using, say, Wine. Right-click on the top text area and choose “add”. Browse to the place you put the AVI files (make sure your config lists a drive location that allows you to reach them!). Select a loaded AVI and click on the big wide button below the text area. The area at the bottom will expand to include a tree entry which lists the tracks in that AVI file.
That’s it, now you have a separate SRT or SSA subtitle. You can either keep it around with the AVI file, or you can use mkvtoolnix to produce a MKV file, taking the subtitle from the text file and the audio and video tracks from the original AVI.
