05 October 2007

SOLVING PHILIPS DVP642 SUBTITLE SUPPORT BUG WHEN BURNING CDS/DVDS IN LINUX

I bought a Philips DVP642K DivX-enabled DVD player some years ago, and I was very happy with it, until I moved to linux. Not that linux is to blame here, it's just that linux is too good adhering to standards and Philips and Ahead/Microsoft seems to like breaking things their own way.

The problem is weird, when you burn a CD/DVD with an .AVI and a .SRT/.SUB file in windows using nero the player reads perfectly [1][2].
Now when you burn the same files using Linux and K3b, the .AVI will be played ok, but the subtitles appears as question marks in the player's main menu, and therefore, won't be loaded.

After some research I discovered that if I burn this files using only pure ISO9660 format in the CD/DVD, they'd work. But there are some drawbacks, mainly is that pure ISO9660 have lots of restrictions on file name length, and allowed characters in file and directory names. So they'd be read on the player, but in Linux and windows it'd look awful.

So, I was trying to fix it last week and stumbled here:

http://www.videohelp.com/dvdhacks/philips-dvp-642/4117#17429

The guy was experiencing the same problem than me, and he seemed to have a solution, only his page was down. Then I saw his cached page:
http://web.archive.org/web/20060214150813/http://arost.redirectme.net/sw/mkisofs/

The problem is that Philips requires that every filename have a version number explicit in the joliet filename. (That is not exactly the standard), Nero seems to do just that, But mkisofs/genisoimage doesn't.

The bottom line is: I managed to fix this by patching and compiling a (rather old) version of mkisofs, and here's what you'll need to do:

-> Get the patch: (credits goes to Alex)
http://web.archive.org/web/20060214150813/http://arost.redirectme.net/sw/mkisofs/versioned-joliet.patch

-> Get the source:
ftp://ftp.berlios.de/pub/cdrecord/ALPHA/OLD/2.01aX/cdrtools-2.01a37.tar.gz

-> tar -xvzf cdrtools-2.01a37.tar.gz
-> cp versioned-joliet.patch cdrtools-2.01
-> cd cdrtools-2.01
-> patch -p1 < versioned-joliet.patch
-> make
-> cd mkisofs/OBJ/
-> And now enter the directory that contains the files for your platform (here is 'i686-linux-cc')
-> There (should be) a file named mkisofs that is executable. That's the patched binary.
-> Copy it to /usr/bin/ (if you have, genisoimage, probably there's a link from mkisofs to genisoimage, remove it)
-> Open K3b, go to Settings, Configure K3b, Programs, Search Path, and add this: "/usr/bin/mkisofs", this way it will force k3b to use this version of mkisofs.
-> And maybe you should also change the buffer size for K3b (still inside Settings, go to Advanced and unmark "Manual writing buffer size")

Now you can burn CDs/DVDs with Joliet and read them nicely in the Philips DVP642, Linux and windows.

Ah, and while you're at it, if you happen to edit the subtitles (or even just open, save and close) in linux, don't forget to run "unix2dos subtitle.srt" so the CR-LF can be changed to the Microsoft/Philips standard.


That's it.
Thanks a lot Alex. This patch should be put in the main genisoimage/mkisofs tree.



[1] Unless of course your .AVI is very new and uses some xvid and divx extensions that weren't available circa 2003, like GMC.
[2] Or even if your .SRT/.SUB is broken.