The first image format that is a goal to import into Matroska is the VobSub subtitle format. This subtitle type is generated by exporting the subtitles from a DVD.
The requirement for muxing VobSub into matroska is v7 subtitles (see first line of the .IDX file). If the version is smaller, you must remux them using the SubResync utility from VobSub 2.23 (or MPC) into v7 format. Generally it should not be a problem though, because any newly created subs will be in v7 format.
The .IFO file will not be used at all.
If there is more than one subtitle stream in the VobSub set, each stream will need to be seperated into seperate tracks for storage in Matroska. E.g. the VobSub file contains streams for both English and German subtitles. Then the resulting Matroska file should contain two tracks. That way the language information can be 'dropped' and mapped to Matroska's language tags.
The .IDX file is reformatted (see below) and placed in the CodecPrivate.
Each .BMP will be stored in its own Block. The Timestamp with be stored in the Blocks Timecode and the duration will be stored in the Default Duration.
Here is an example .IDX file:
|# VobSub index file, v7 (do not modify this line!)
# To repair desyncronization, you can insert gaps this way:
# (it usually happens after vob id changes)
# delay: [sign]hh:mm:ss:ms
# [sign]: +, - (optional)
# hh: hours (0 <= hh)
# mm/ss: minutes/seconds (0 <= mm/ss <= 59)
# ms: milliseconds (0 <= ms <= 999)
# Note: You can't position a sub before the previous with a negative value.
# You can also modify timestamps or delete a few subs you don't like.
# Just make sure they stay in increasing order.
# Original frame size
# Origin, relative to the upper-left corner, can be overloaded
# Image scaling (hor,ver), origin is at the upper-left corner or
at the alignment coord (x, y)
# Alpha blending
# Smoothing for very blocky images (use OLD for no filtering)
# In millisecs
# Force subtitle placement relative to (org.x, org.y)
# For correcting non-progressive desync. (in millisecs or hh:mm:ss:ms)
# ON: displays only forced subtitles, OFF: shows everything
# The original palette of the DVD
# Custom colors (transp idxs and the four colors)
# Language index in use
First, lines beginning with "#" are removed. These are comments to make text file editing easier, and as this is not a text file, they aren't needed.
Next remove the "langidx" and "id" lines. These are used to differenciate the subtitle streams and define the language. As the streams will be stored seperately anyway, there is no need to differenciate them here. Also, the language setting will be stored in the Matroska tags, so there is no need to store it here.
Finally, the "timestamp" will be used to set the Block's timecode. Once it is set there, there is no need for it to be stored here. Also, as it may interfere if the file is edited, it should not be stored here.
Once all of these items are removed, the data to store in the CodecPrivate should look like this:
There should also be two Blocks containing one image each with the timecodes
"00:00:01:101" and "00:00:08:708".