Over the last few months I’ve been ripping our dvd collection to files, so we can play them over the network on our PVR (Beyonwiz DP-P2) in a much more convenient fashion for us than finding the dvd and mucking around with the dvd player. C has been particularly enamoured of our Pixar collection: Toy Story; Toy Story 2; Monsters, Inc; Finding Nemo; (we have others, but she’s too young to watch them yet).
One aspect of this which has made things painful for J and I is that when we’re playing these Matroska files, the audio is out of sync with the video. The problem starts at the start of playback, and over the course of a movie gets to the state where the difference is 3 to 4 seconds. Most definitely headache-inducing stuff for us, but C doesn’t appear to notice or care – for now!
I did a bit of digging over the last day or so (you can see its relative importance in my stack of tasks!) and discovered that there are two components to the problem. Firstly, the Beyonwiz doesn’t seem to cope with Matroska files that have embedded chapter entities. Secondly, the Beyonwiz doesn’t seem to cope with more than one audio track (aac and ac3, for these) embedded in a Matroska file.
To fix this, I made a copy of my original Matroska file because when we upgrade our playback capabilities (to something with more grunt, and using either xbmc or Plex), this won’t be a problem. I used mkvpropedit to remove the chapter markers from the copy, and then used ffmpeg to transcode the copy to an mp4 and generally fix everything else.
Command-line wise, it went like this:
$ cp Toy_Story.mkv TS_1.mkv
$ mkvpropedit -c "" TS_1.mkv
$ ffmpeg -i TS_1.mkv -vcodec libx264 -acodec copy -ab 160 Toy_Story.mp4
Both ffmpeg and mkvpropedit came from the OpenIndiana SFE repos (http://pkg.openindiana.org/sfe and http://pkg.openindiana.org/sfe-encumbered)
Now the only problem I have to work around on the Beyonwiz is that it seems to have a memory leak with playing mkv or mp4 files, so if I try to play one and get the ‘Unsupported format’ error a reboot of the appliance is required. Tedious, but simple. Wish I had the source…..
 NOTE: this is our own, we-paid-hard-cash-for-the-disks DVD collection.