Monday, August 30, 2010

Converting KDVD into KSongLover-compatible Media Files

Since KSongLover doesn't seem to support VOB files (and even if it did, it would not support switching between language tracks, which is how most KDVDs implement voice/accompaniment-only channels), I've been exploring ways to convert VOB files into KSL-compatible formats, namely MPEG-1/2. MPEG-1 definitely works with KSL, since that's really just KVCD format. I have yet to test MPEG-2 files with KSL, but I've gone ahead and tried to convert VOB files into MPEG-2 anyway.

I tried a bunch of tools, including (but may not be limited to... it was late at night and my memory might be lossy):
  • DVD Decrypter
  • VOB2MPG
  • TMPGEnc
  • PX3's AC3 to WAV
  • Audacity
  • ImagoMPG-Muxer
  • EncWAVtoAC3 (essentially Aften)

At the point, it seems easiest to do the following:

  1. Using DVD Decrypter, extract the video (choosing the angle with karaoke lyrics) and the audio streams (both voice and accompaniment AC3 stereo tracks) into demux'ed M2V and AC3 files.
  2. The M2V file is good, we don't want to re-encode it or touch it in anyway; the AC3 files, on the other hand, need to be combined into a single wave file, with the accompaniment on the left channel and the voice on the right channel.
  3. To do that, first convert the two AC3 files (for the two language tracks) to WAV's, using PX3. This will yield two stereo WAV files.
  4. Using Audacity, import both WAV files. Pan one track (most likely the accompaniment) all the way to the left, and the other all the way to the right. Export as a single WAV file.
  5. Now we need to convert the WAV file back into AC3 so it can be combined with the video into an MPEG-2 file. Use EncWAVtoAC3 (or Aften in command-line) to do this. Note: I tried mucking about with the options at first, especially the channel settings, but I had trouble getting it to encode. I found that the default options actually worked best.
  6. At this point, the AC3 file should play properly in a DVD-player software such as Cyberlink's PowerDVD, with voice only on one channel (in my case, the right side).
  7. Using ImagoMPG-Muxer, select the M2V file as the video source and the new AC3 file as the audio source. Make sure the output format is selected as MPG, then just Multiplex!
  8. Et voila! Try playing the MPG file in a DVD-Player software (again, like PowerDVD) and you should have it all: video with lyrics, accompaniment on the left speaker, and voice on the right.
So there you have it, eight simple steps. Of course, like I said, I still have to test it on KSL.

You'll notice that two of the tools I tried weren't used in the final procedure: VOB2MPG and TMPGEnc. The reason being that both involved re-encoding the video stream, which I felt was unnecessary for our purposes - we really just want to move some audio channels around. Demuxing and muxing, I felt, kept the highest possible fidelity with regards to video.

Oh, and the other reason neither VOB2MPG and TMPGEnc were used was because both cost money to get the full feature-set. :-P

P.s. (2:29PM) I found out why Media Player played the MPG file with the left and right channels blending into each other - I had misconfigured ffdshow. My bad. All is well.

No comments: