DAPHNE laserdisc conversion tutorial

How to use DAPHNE to play laserdisc games without having a real laserdisc
A guide written by the following people: (add your name as you add content, no matter how small)
Matt Ownby

These three steps are required to get DAPHNE up and running.
1 - Convert your laserdisc to DAPHNE's unique format.
2 - Create a frame file so that DAPHNE knows how to use the content that you've created.
3 - Run DAPHNE's seektest to calibrate your video/audio files to make sure they are aligned properly with the laserdisc.
You should be ready to run DAPHNE and play the game. For your laserdisc type, you will need to use the type 'vldp'. You will also need to specify what your frame file that you created is called, using the -framefile switch. So for example, if I want to play Dragon's Lair and my frame file is called lair.txt, then I'd run daphne by typing "daphne lair vldp -framefile lair.txt". Good luck ...

Convert your laserdisc to DAPHNE's unique format (required)
DAPHNE uses mpeg2 (or mpeg1) for video and Ogg Vorbis for audio. This is unusual, so you might want to read this entire section instead of skimming it.
1 - You will need a video capture card, preferably one that can capture at least 640x480 . Common video capture formats include MJPEG, mpeg1, and mpeg2.
2 - Capture the entire laserdisc using your video capture card, in as high of quality as your hardware will allow.
3 - You will need to separate the video and audio into individual files (when capturing video and audio, your video capture card usually merges the video and audio into one single file). To separate an mpeg1 or mpeg2, you can use tmpgenc or bbdmux from bbtools. To separate an mjpeg, you can probably use virtualdub (although I'm not really sure).
4 - You will probably have to re-encode the video stream. All video streams need to be in mpeg2 video (or mpeg1 video) format. MJPEG users will need to use a tool like tmpgenc to convert their video stream to this format. You also may need to change the video to a different resolution. Use the following resolutions for the following discs:

Disc Name | Resolution of video
Dragon's Lair | 640x480 *
Space Ace | 640x480 *
Cliff Hanger | 640x480
Super Don Quixote | 512x480
Esh's Aurunmilla | 512x480
Thayer's Quest | 640x480 *
Astron Belt | 512x480
Galaxy Ranger / Starblazer | 512x480
Cobra Command (Astron belt hardware) | 512x480

* - This video file can be any resolution (720x480 for example) but performance will be best if it is 640x480. You have been warned.
NOTE: If you are converting Dragon's Lair or Space Ace, you should convert the frame rate of the video from 29.97 fps to 23.976 fps. For a more extensive guide on re-encoding video, click here . Most (all?) other cartoon based games would greatly benefit being converted to 23.976 fps, but some games (Cliff Hanger) currently have trouble if they are not 29.97 fps.
5 - You will need to convert your audio stream to Ogg Vorbis format. You also will need to make sure the audio is at 44.1 kHz. If your audio stream is at 48 KHz, for example, you'll need to use a tool like Sound Forge to resample down to 44.1 kHZ.
6 - You should now have a video stream in mpeg2 video or mpeg1 video format, and an audio stream in ogg format. Make sure the video and audio streams are located in the same directory and that they have the same name except for the suffix. For example, you could have a video file called mymovie.m2v and an audio file called mymovie.ogg stashed in a directory called 'stuff'.
7 - Confused? Here is one example of how to do all of what I just described. Someone else should add another example.

Create a frame file so that DAPHNE knows how to use your video and audio (required)
1 - Make a simple text file called whatever you wish and put it inside the 'framefile' directory in your main daphne directory. For example, I might want to make a file called d:\daphne\framefile\ace.txt if I was a windows user.
2 - The first line of this file should contain the full path to your video and audio files. For example, if my video file was d:\mpeg2\sa_hq.m2v then the first line of my ace.txt file would be d:\mpeg2\
3 - Each line after the first line should have two entries. The first entry is the laserdisc frame number that corresponds to the first frame of your video file. The second entry should be the name of your video file (the audio file's name is calculated using the video file's name--that's why they have to be named similarly!). So for example, the second line in my ace.txt file I have would be 1 sa_hq.m2v
This means that the first frame of my sa_hq.m2v corresponds with frame #1 of a real space ace laserdisc. If you don't know for sure which number to use, just take a guess (0 is usually safe). You will be making this number exact when you run the seektest. If you have multiple video and audio files, just add more lines using the same format.
Example #1
One huge file for Space Ace where the video and audio files are located at d:\mpeg2\sa_hq.m2v and d:\mpeg2\sa_hq.ogg and the first frame of the mpeg corresponds exactly with the first frame of the laserdisc.
d:\mpeg2\
1 sa_hq.m2v
Example #2
Three pairs of files that contain an arbitrary laserdisc, located in the c:\files directory and called part1.m2v, part1.ogg, part2.m2v, part2.ogg, part3.m2v, part3.ogg. Let's say that part1 holds the video for frames 1-1299 of the laserdisc, part2 holds the video for frames 1300-14999 of the laserdisc, and part3 holds the video for frames 15000 until the end of the laserdisc. Then your frame file would look like this:
c:\files\
1 part1.m2v
1300 part2.m2v
15000 part3.m2v
When you've created this file, save it inside the 'framefile' directory.

Calibrate your frame file so it is properly aligned with the original laserdisc (required)
DAPHNE has an internal tool to help you get your mpeg aligned with the original laserdisc (so that you don't have to guess on what frames to use for your frame file).
To calibrate your video file, run daphne using the following command line:
daphne seektest vldp -framefile yourframefile.txt -preset xx
(you need to use the name of the frame file that you created). The xx corresponds to one of the following numbers:
0 - Dragon's Lair
1 - Space Ace
2 - Super Don
3 - Cliff Hanger
4 - Astron Belt
5 - Galaxy Ranger
6 - Thayer's Quest
If your game isn't listed here, it means we haven't made a seektest for it yet. Doh!
If all goes well, you should be presented with a black screen. Pressing left, right, up or down will seek to a frame in the mpeg file. You should make sure that the frame it seeks to matches up with the images you see below.
NOTE #1 : The first time a seek or a play is issued to the mpeg, it will parse the mpeg video file and created a lookup table of the address of each frame. This can take quite a while sometimes as long as ten minutes on really long files. A little red line will draw itself from left to right on the screen to indicate its progress. Just kick back and let it do its thing. When it's done, a frame from the mpeg file will be displayed on the screen. It will be different for each disc. Using these frames you can tell if your frame file is correct and adjust accordingly.
NOTE #2 : The frame numbers displayed on these screen shots should NOT appear in the mpeg. They are here only to show which laserdisc frame is being rendered.
Dragon's Lair (preset 0)

Left | Right | Up | Down

Space Ace (preset 1)

Left | Right | Up | Down

Super Don Quixote (preset 2)

Left | Right | Up | Down

Cliff Hanger (preset 3)

Left | Right | Up | Down

Thayer's Quest (preset 6)

Left | Right | Up | Down

Ok, so what do you do if you don't see what you're supposed to see?
Well, let's take Dragon's Lair for example. If your frame file looks like this:
d:\mpeg2\
0 dl.m2v
and moving left and right both show you two red attract mode frames, then that means you need to decrease the number to the left of "dl.m2v"... for example, you might try changing the number to -1 or -2. Yes, negative numbers are valid. On the other hand, if moving left and right give you two black frames then you will need to try increasing the number to 1, 2, or higher.
You need to keep running the seektest and adjusting your frame file, until you see the frames that you are supposed to see. Once you see what you're supposed to see, you're ready to play the game! If you can't get both the left/right and the up/down to match, then give the left/right priority and realize that your mpeg might have missing frames in it.

Example #1 : A simpler Dragon's Lair conversion (recommended, but optional)
1 - Capture the entire Dragon's Lair disc using your format of choice (preferably MJPEG or MPEG2). Make sure to record both audio and video.
2 - Run tmpgenc .
3 - For your video source at the main screen, click browse and locate your file. If it's an AVI (MJPEG) it should load right up. If it's an mpeg2, you might need a DVD player installed such as powerDVD to use it. See the Space Ace example for a way to avoid using commercial software.
4 - The audio source should be the same file as the video source.
5 - Choose a sensible output file name. Make sure the stream type is set to System (video+audio).
6 - Click Setting.
7 - Click on the Advanced tab. Set the video arrange method to "Full Screen", do not preserve aspect ratio. You will have to guess on the Field Order. Try using both of them and pick the one that looks the best. I would try A before B.
8 - Enable Inverse Telecine. Leave it set to flicker priority. This will convert the video back to 23.976 fps where it belongs.
9 - Double click on noise reduction to bring up the noise reduction menu. Set still picture to 50, range to 2 and enable High Quality mode. Click on OK and make sure that noise reduction is enabled.
10 - Click on the audio tab and make sure the sampling frequency is 44100 Hz and stereo. Choose a sensible bitrate (160 is pretty nice).
11 - Click on the video tab. Set the stream type to MPEG-2 Video. Set the size to 640x480. The aspect ratio should be 4:3, the frame rate should be 23.976. Set the rate control mode to constant quality (CQ). Click on the Setting button next to the Rate control mode and set the maximum bitrate to 10,000 and the minimum to 0. Set the quality to whatever you want depending on how big you want the file to be. A quality of 60 should fit on 1 CD, a quality of 100 should fit on 3 CD's. Set the video format to NTSC, and the encode mode to Non-interlace.
12 - You can play around with changing other things if you wish.
13 - Click ok at the bottom of the window to close it.
14 - Click the Start button at the top. It will go through and compute the inverse telecine which can take a while. Then it will create an mpeg2 system stream. It takes around 8 hours on an Athlon 800. If you want it to go a lot faster, disable noise reduction (that's what really slows it down).
15 - Once it's done, go to File->MPEG Tools. Click on the De-Multiplex tab.
16 - Click the browse button and locate the new mpeg2 system stream you've just created.
17 - Double click on the video and audio streams and save them to separate files.
18 - Quit tmpgenc. You're done with it.
19 - Open WinAmp or something that can read mpeg audio. Tell WinAmp to output to a .WAV file then play the file. It should save a .WAV file to disk of the uncompresed audio. You can also use SoundForge to do this.
20 - Run the OggDrop program . It should open up a little window. Right-click on it and choose your bitrate. The higher the bitrate, the larger the file and better the quality is. Then drag your .WAV file on top of the window and it will encode it to OGG format.
21 - Take your mpeg2 video stream and your ogg audio stream and put them in a directory somewhere, using similar filenames such as dl.m2v and dl.ogg .
22 - Congratulations, you're done with the conversion!
Example #2 : Space Ace using mpeg2, a bit more advanced (optional)
This method uses virtualdub to do a better inverse telecine than tmpgenc can do. It does take a few more steps though, so unless you really want a nice looking Space Ace, you probably don't need to bother with this.
1 - Capture the Dragon's Lair disc to an mpeg2 system stream (video and audio combined). Some video capture cards such as Dazzle's Digital Video Create II can do this. Use a constant bitrate of 10,000,000 to get max quality. Set the audio to 44100 Hz (not 48000).
2 - Install the HUFFYUV lossless codec in windows. We are going to do some processing with VirtualDub so we need to convert the file to AVI. The lossless codec will allow us to do this without sacrificing any quality.
3 - Using FlaskMPEG, convert the mpeg2 file to a HUFFYUV AVI file. This will probably take up a little under 20 gigs. Tell it to not process audio (ie, throw it away).
4 - Open VirtualDub and open your new AVI file. Change the frame rate to 23.976 using VirtualDub's manual Inverse Telecine option. You'll have to keep trying values between 0 to 5 until you get the right one. You can click on the virtual dub play button to see if you've got the value set correctly. If you've got it correct you should see no interlacing lines appearing on the screen.
5 - Tell VirtualDub to save the new file using HUFFYUV again (it defaults to uncompressed video which is not good).
6 - Save your new AVI. It should save it at 23.976 frames per second and remove all those ugly interlacing lines. Now it'll look good on a computer monitor!
7 - Now open tmpgenc and load up your latest AVI that you've made. Make sure the new video is mpeg2 (video only!), and 640x480, and make sure not to preserve the original aspect ratio. For your encoding type, if you want it to look the best, choose constant quality and set it to 100 (the max!). Make sure you encode it to be non interlaced instead of interlaced. You may also want to add some noise reduction (it can really make it look a lot better), and clipping (if you recorded at 720x480, you will have black bars on the side that you could stand to get rid of with clipping). Once you've settled on your settings, click the START button and tmpgenc will begin creating your mpeg2 video file. This could take an hour if you used minimal settings or longer (like 8 hours) if you went for higher quality.
8 - When it finishes, you'll have your video file. Now for the audio.
9 - Snag the bbdmux program from the bbtools package. Use it to extract the audio stream from your original mpeg2 file. You do it by typing something like this: "bbdmux originalmpeg2.mpg 0xc0 originalaudio.m2a"
10 - Break out WinAmp or Sound Forge or something that can read mpeg audio files. Save the file as a raw .WAV (44100 kHz!)
11 - From www.vorbis.com you should be able to download utilities to convert WAV to OGG. I think Sound Forge can also save files as OGG. At any rate, you'll want to convert the audio to OGG format. Use whatever bitrate you feel like, I've been using 128k and it seems to be fine.
12 - You should be about done now. Make sure your files are in the same directory and similarly named. For example, call the video file dl.m2v and the audio file dl.ogg . You should be ready to go!

A more extensive guide on video re-encoding
to be written :)