Saturday, July 30, 2011

WDTV Live Subtitle Issues

I have two WDTV Live media players at home, both running the latest 1.05.04_V firmware. I've been testing them for months and made a list of bugs I found, posted those that others had not found yet on the official forum. Instead of WD fixing the ever-growing list of bugs new features keep popping up. I am a simple guy who wants to watch movies on the player and even on my laptop I hardly ever use Facebook and all the other internet services that have been added to the player's feature list recently.
There's a thread about subtitle issues that Techflaws started last year. Being bitten by those bugs I decided to stop waiting for WD and instead of starting to whine on the forums be more constructive.
Here are my findings about the vobsub related issues.

Issue 1: Internal Vobsubs (idx/sub) are messed up, apparently some colors of the palette are ignored/replaced

I extracted subtitles of various dvds, muxed them into mkv files and starting analyzing their behavior on the media player. I made a small chart about
  • the 16-color palette
  • the 4 color indexes referring to a color in the palette
  • the alpha (opacity) values for each of those 4 colors
  • how the 4 colors of the image are used - which is for the background, the outline, the pattern and the anti-alias
I came to the conclusion that the media player ignores the opacity value of the last color and sets it to zero causing that color to be transparent all the time. If that color is used
  • for the outline then subtitles show up without outline
  • for the pattern then you can see through the characters
  • for the anti-alias then you can see through the anti-alias part between the outline and the pattern
  • for the background then everything's fine since the background is already transparent
Though it seems to be traditional to use the first color (with index 0) as the always transparent background I did not find any information about this being required. All 4 colors are equivalent and might as well be reordered.
If I can swap a transparent color (which already has the alpha value set to zero) with the last one (where the media player has the hardcoded zero alpha value) then the subtitle will look good regardless of being internal or external.

What has to be done is
  • finding a color with zero alpha value (there should be one: the background)
  • swap the index of the transparent and the last color in the rle-encoded subtitle stream
  • swap the palette references
  • swap the alpha values
I have modified the BDSup2Sub source to prove my point. If you load your sup or idx/sub file and set the palette mode to "keep existing" then on the Save/Export dialog you will find a checkbox with which you can activate the workaround I described above.
If you're one of those console guys I have some good news for you: I added a command line switch as well. The following command will use en.idx as input and save to en_exp.idx file. It will keep the resolution, the palette and apply the wdtv workaround. 

java -jar bdsup2sub-wdtv.jar en.idx en_exp.idx /res:keep /wdtv+ /palmode:keep

I updated the help page where you can find the description for all the other command line switches as well.

I sorted out the license issues with BDSup2Sub and it can be downloaded from here. Sources are available here.

Note: This is a modified version of BDSup2Sub 4.0.0 and since it's modified please do not contact the original author (0xdeadbeef) if you have issues with it. Only use this version if you need the WDTV Live workaround feature since otherwise it is identical the the original 4.0.0 version.

Issue 2: dropouts - certain subtitles are not displayed.

I managed to find some subtitle streams that expose this issue and analyzed them. Those subtitles that did not show up do not have the end time set, in other words their duration is indefinite. The player in this case should show the subtitle until another one comes along.
The workaround I could think of was to set an explicit end time for these sub frames. Luckily BDSup2Sub already does this just by loading and exporting subtitle. In the log window you can see a warning about the missing subtitle end time: "WARNING: Invalid end sequence offset -> no end time"

The thread lists some other bugs as well but those are either such that I can live with them (e.g. default stream settings are ignored) or there's not much I can do with them at this point (e.g. PGS (SUP) subtitles from Blu-Rays are only supported in m2ts but not mkv containers).
The two workarounds above satisfy my need at the moment. I decided to publish my findings hoping others can also enjoy their hardware better or I can help WD to find the root cause and fix the issue.
Feel free to leave a comment if you found my findings or the modified BDSup2Sub useful and let's hope together that WD will eventually fix these issues.

Update 1: PGS (SUP) subtitles from Blu-Rays are supported in the latest firmware (1.06.15_V) not only in m2ts but also in mkv container. It works well if the mkv is made with MKVToolNix and does not work if it is made with MakeMkv. For now I suggest you reprocess your mkv with MKVToolNix since that creates the most standard compliant mkv structure.

Update 2: DHStraayer created a tool to help users who have WDTV Live to rip DVDs and Blu-Ray discs to mkv files, especially to deal with bugs in the WDTV Live firmware that interfere with subtitles.
If you have any questions about the tool please contact the original author.


  1. Great info. Thanks for sharing.

  2. Brilliant! Two birds with one stone!

    fantastic work. Now if the WDC folk would just take the fine work you've done in identifying the problems, and fix their firmware, it would be even better.

  3. Great job! Do you have any plans to continue the development on BDSup2Sub?

  4. @Jaisa

    I tried to contact the original author but I did not succeed so after a while I set up a repository on github based on the latest source.

    I have fixed 3 issues already:

    Eventually I will make a binary release that can be easily downloaded.

    If you run into any of the issues I already fixed let me know and I will send it to you.

  5. WD_MKV is a program to help users who have Western Digital ® WDTV Live and WDTV Live + players to rip DVDs and Blu-Ray discs to MKV files, especially to deal with bugs in the WDTV Live.
    The first bug is related to the four “colors” in the subtitles. The WDTV always makes “color 4” transparent, whether or not it is the “background” color that is supposed to be transparent.
    The second bug is that the WDTV refuses to display the subtitle file format used in Blu-Ray discs when they are in the “.mkv” Matroska file format.

    The WD_MKV runs the popular MakeMKV ripper, extracts the files in the resulting .mkv file using mkvExtract, then fixes the subtitle files (using a special version of the bdsup2sub program), and re-assembles the .mkv file using mkvMerge.

    An exe, and all the java source code of the project, can be found at: [url][/url]

    There is a PDF there with documentation.