NOTE: This appiles to r10.x versions. r11/r11.x versions are different.
Making dump files
- Load the movie file (as savestate or as movie, it doesn't matter if it starts from poweron).
- If you have some sort of subtitle Lua script, start it.
- Go to system -> dumping control
- There's box on line called "<video>". Fill something like foo-video.dump as destination. Hit start button that just got enabled.
- Now, there is box on line called org.jpc.emulator.peripheral.PCSpeaker-0. This is the PC Speaker sound output. If it is the only other output besides video, then you want to capture it. If there are others as well, chances are PC speaker is not used and can be left uncaptured. If you need to capture it, fill something like foo-speaker.dump as destination. See section "using skip" for explanation of what skip field is for.
- Other output you may see are org.jpc.modules.FMCard-0 / org.jpc.modules.SoundCard-1 (FM synth output). If this line is present, that output should be captured. Fill something like foo-fm.dump as destination and apporiate skip value (see "using skip").
- Other output you may see is org.jpc.modules.SoundCard-0 (PCM digital output). If this line is present, that output should be captured. Fill something like foo-pcm.dump as destination and apporiate skip value (see "using skip").
- Hit start button on all channels to capture.
- Hit close.
- If you want to, you may want to enter command trap-timed <duration-in-ns> to JPC-RR command line (it is the console window you started JPC-RR from). <duration-in-ns> is duration of the movie in nanoseconds (put 9 zeros after number of seconds). This way the dumping automatically cuts out at specified time. This is optional.
- Hit System -> Start. The movie dumping starts.
- Wait until the dumped segment ends. Then just close the emulator (either from close window button of JPC-RR window or System -> Quit). The emulator closes dumps as part of orderly shutdown, even if there is active dump going on.
- Now you have the dump files.
- If you want to, you can dump to named pipe / named FIFO.
- Concatenation of dump files is concatenation of their contents.
Skip delays the audio by specified amount. This is useful for compensating the length of encoder logo and codec delay. For instance, if your logo is 2 seconds long and audio codec delay 105ms, you might want to put 1.895 to skip box. Few notes:
- Put the same skip value to all used outputs or audio channels will be off-sync.
- If value has . in it, then the unit is seconds, otherwise nanoseconds. So 2.0 is 2 seconds but 2 is 2 nanoseconds (2000000000 is 2 seconds).
- Blank skip value means no delay.
- Negative skip values are not currently possible.
Converting dump files to RGB / RAW / WAV:
After you got the dump files, you need to convert them to some usable format. For this, you need rawtoaudio2.exe and rawtorgb.exe. There are prebuilt versions for Windows and they can be built from sources (the sources are included in JPC-RR sources).
Converting video to raw RGB file.
rawtorgb.exe foo-video.dump foo-video.rgb lanczos2 640 400 16666667
This instructs to dump the video dump as raw RGB dump of 640x400@60fps. Note that while most games use 320x200 that gets scan-doubled/doublescanned to 640x400, not all games do. See the size of window when in-game for proper value. lanczos2 sets resizing algorithm to Lanczos resizer with alpha of 2.
The raw RGB dump is in in RGBx format, with framerate of 60fps and specified frame size. Tools like mencoder, ffmpeg or gst-launch can be used to encode these further. Watch out, the dumps are large! You might want to send them to pipe (this also avoids 2GB problems on some platforms).
Converting audio to WAV file.
- For PCSpeaker output: rawtoaudio2.exe --input-file foo-speaker.dump --input-format=pcm --output-file=foo-speaker.wav --output-rate=44100 --output-attenuation=20 --output-format=wav
- For FM synthetizer output: rawtoaudio2.exe --input-file foo-fm.dump --input-format=fm --output-file=foo-fm.wav --output-rate=44100 --output-format=wav
- For PCM digital output: rawtoaudio2.exe --input-file foo-pcm.dump --input-format=fm --output-file=foo-pcm.wav --output-rate=44100 --output-format=wav
The --output-attenuation=20 is to attenuate the otherwise extremely loud PC Speaker channel. If there are multiple used channels, you need to mix them together (using something like sox).
Then encode the resulting wav with whatever codec desired.
Converting audio to raw file.
Use this only for runs over 3 hours (for smaller runs, use the wav file method). This method avoids the Wav file size limit.
- For PCSpeaker output: rawtoaudio2.exe --input-file foo-speaker.dump --input-format=pcm --output-file=foo-speaker.raw --output-rate=44100 --output-attenuation=20 --output-format=raw
- For FM synthetizer output: rawtoaudio2.exe --input-file foo-fm.dump --input-format=fm --output-file=foo-fm.raw --output-rate=44100 --output-format=raw
- For PCM digital output: rawtoaudio2.exe --input-file foo-pcm.dump --input-format=fm --output-file=foo-pcm.raw --output-rate=44100 --output-format=raw
The output files are 44100Hz signed 16bit little-endian stereo. Convert them using suitable program.