How To Guide: Encoding Cinepak Videos Properly

GO TO ADMIN PANEL > ADD-ONS AND INSTALL VERTIFORO SIDEBAR TO SEE FORUMS AND SIDEBAR
Joined
May 12, 2007
Messages
209
Points
43
So encoding Cinepak Videos can be a bit cumbersome. While Cinepak encoders are a dime a dozen, finding one that will produce something that the Saturn likes while still looking decent is a bit more challenging. AviToSaturn while useable, tends to produce sub-par results, and always garbles the audio requiring you to remux it with FFMPEG. So the best process at this time is to instead use the old Mac tools and go through the official encoding pipeline Sega and other developers used. So here are the steps.

You will need the following:
  • VirtualDub Software on the OS of your choice.
  • A classic Macintosh Environment on OS 7, OS 8, or OS 9. In this guide I'll be using SheepShaver to emulate a Macintosh OS 9 Environment.
  • Sega's Cinepak libraries. (These can be found here: Dezaemon 2 Save Game Manager Vol. 2 and CPK Viewer Source Codes) The tool we want in particular is MovieToSaturn.
  • QuickTime 2.5 and Quicktime 4 or higher.
Setting up your Macintosh Environment (I'm not going to go into much detail here as there's plenty of guides out there for this):
  1. You'll need to get your Macintosh set up with either OS 7, 8, or 9. Make sure it's a Power PC Macintosh as the 68k ones don't support certain functions.
  2. Install Quicktime 4 if it's not already installed. This will allow you to open and play uncompressed AVI files.
  3. Copy the Movie Player application from Quick time 2.5 onto your Macintosh. This is the last free version that allowed you to export/convert videos.
  4. Copy the MovieToSaturn application onto your Macintosh.
  5. Optional - Install the Japanese Language pack (this is useful for translating errors MovieToSaturn can throw.)

Encoding your video:
  1. Obtain a good quality raw video file. - If you have access to higher quality versions of your video file, use them. You want to avoid using the original Saturn files if at all possible as then you'll be compressing something that was already compressed which will give poor results. Garbage in Garbage out basically.
  2. Downscale your video to the desired resolution in VirtualDub. Do any other kinds of editing here. (Adding subtitles, fancy effects, changing Framerate, etc.)
  3. Next you want to set your Audio compression setting to "Direct Stream Copy". Set your Video Compression settings to "Uncompressed".
  4. Save your Video as an AVI file.
  5. Copy your new video file over to your Macintosh Enviroment.
  6. Open QuickTime Movie Player 2.5 and select "Open".
  7. Select the file you wish to encode and select "Convert"
  8. Click File, and select "Export"
  9. Make sure "Movie to Quicktime Movie" is selected in the Export drop-down.
  10. Click "Options".
  11. Under "Video" click the "Settings" button.
  12. In this window, select "Cinepak" for the codec and "Millions of Colors" for the color depth. (256 Colors is also allowed.)
  13. Adjust the quality meter to the desired settings. Medium is a good starting point.
  14. Set the frame rate to your videos Framerate. The default Keyframe setting of 24 seems to work fine.
  15. Set the bit Rate to the desired value. The max the Saturn can do is 300KB/s. However you need to take audio into consideration. So play with this to find a desired value. 200-275 seems to be safe from what I've tried. Adjusting this can also help get the size just right if you need to fit into a specific size.
  16. Click "Ok"
  17. Under "Sound" click the "Settings" button.
  18. Select "None" for compressor, and select the desired Rate, Size, and Channels. Both 8-bit, and 16-bit are allowed, as are Stereo and Mono. Common rates on Saturn are 8000, 11025, 16000, 22050, and 32000. Note: If you want to use ADX encoding then you'll need to encode your video without sound and then use FFMPEG to remux the ADX audio in later.
  19. Click "Ok"
  20. Uncheck "Prepare for Internet Streaming"
  21. Click "Ok".
  22. Type the desired name for your new MOV file, and click "Save".
  23. Your video will now start encoding. This can take some time as Mac OS 7-9 wasn't really a fast OS, and the machines are pretty slow by todays standards.
  24. Once the file has been saved, open up MovieToSaturn and select the MOV file you just created.
  25. Click "Open"
  26. Click the bottom right button that has the border around it:
  27. Wait while it turns your MOV file into a CPK file. When finished you should see a window like this:
  28. Move your file off of your Mac and back to your original Dev system.

And that's it. You should now have a Saturn compliant Cinepak file in decent quality. You can now try it in your game or try it in MadRoms CPK Viewer application that was included in the Cinepak libraries linked above.

If you needed to use FFMPEG to remux the audio, MsTea has a guide for that here:

Note: MovieToSaturn can sometimes throw fits and will give you an error. Usually this means there's something it doesn't like about your file. The best I can tell you is to just try exporting it again. I've had it throw a fit on one file, then when I re-exported it with the same settings it was happy with that one.
 
Last edited:
Joined
May 12, 2007
Messages
209
Points
43
One other thing to add. It seems that one thing Sega and others did to make Animation compress a little better is to slightly boost the contrast, and then turn the sharpness dial up to 11. While at higher resolutions you'll get artifacts from this, at this low of a resolution it actually seems to help the Cinepak encoder do a better job compressing so you don't get as many "dancing pixel" artifacts.
 
Joined
May 12, 2007
Messages
209
Points
43
So after encoding all the subtitled FMVs for Sakura Wars, I figured I'd see how far I could push the quality in this setup. So here are the results:


The video is encoded with quality set the highest in the Quicktime tools, Video Bitrate capped at 270KB/s, and audio is at 16-bit Mono at 22050Hz. This resulted in a file that was ~290KB/s. The reason I went with this video was because all the crazy anime stuff going on in a lot of the shots seemed like a good test for how well the compression could handle fast moving objects and what not.
 
Top