Making dump file
- 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 -> Start Dumping
- Pick file to save the dump to.
- 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 file.
Notes:
- If you want to, you can dump to named pipe / named FIFO.
- Concatenation of dump files is concatenation of their contents.
Programs needed
- dumpconvert.exe (from JPC-RR stream tools).
- x264 (for --output-x264) (This file needs to be downloaded.)
- oggenc (for --output-oggenc) (optional, for Ogg Vorbis)
Making lossless video and audio
60 fps fixed
dumpconvert --video-width=640 --video-height=400 --video-framerate=60 --audio-delay=1.895 --output-wav=audio.wav --output-x264=raw.avi,crf=0,fullrange=on dump.jmd
-
--video-width=640
Sets video width to 640. 640 is the most common value here (its rare to see anything else). See the emulator statusbar during actual game to see what to put here. -
--video-height=400
Sets video height to 400. 400 is the most common value here (480 is also ocassionally seen, anything else is rare). See the emulator statusbar during actual game to see what to put here. -
--video-framerate=60
Set video framerate to 60. For videos with anything else as framerate, its simpler to use automatic framerate as opposed to trying to figure out what the proper framerate is. -
--audio-delay=1.895
Delay audio by 1.895s. The proper value here is length of logo minus codec delay. 1.895 is for 2 second logo and 0.105s codec delay (HE-AAC at 44100Hz). If you use Ogg Vorbis as codec, this is the logo length. NOTE: 2 (2 nanoseconds) is not the same here as 2.0 (2 seconds)! -
--output-wav=audio.wav
Output audio as WAV to audio.wav -
--output-x264=raw.avi,crf=0,fullrange=on
Output video as raw.avi, settings being "lossless" encoding (crf=0). -
dump.jmd
The actual dump file.
If Ogg Vorbis audio is OK and you have oggenc, you could also replace
--output-wav
option with --output-oggenc=audio.ogg,quality=3
(adjust quality to taste, 3 is reasonable). In this case, the audio delay should be length of logo, since Vorbis has no known codec delay.
If you don't have x264 that works with dumpconvert, you can also dump raw i420 by using
--output-rawi420=video.yuv
instead of --output-x264
option. If this results red and blue swapped around, use --output-rawi420-uvswap=video.yuv
(swap red and blue before writing). Note that these files will be large.
Variable fps
dumpconvert --video-width=640 --video-height=400 --video-framerate=auto --audio-delay=1.895 --output-wav=audio.wav --output-x264=raw.avi,crf=0,fullrange=on --output-timecodev2=times.txt --video-max-dedup=29 dump.jmd
-
--video-width=640
,--video-height=400
,--audio-delay=1.895
,--output-wav=audio.wav
,--output-x264=raw.avi,crf=0,fullrange=on
see above -
--video-framerate=auto
Set automatic variable framerate -
--output-timecodev2=times.txt
Write timecode data to times.txt -
--video-max-dedup=29
Allow eliding up to 29 back to back identical frames -
dump.jmd
The actual dump file.
Note: Due to output being variable fps without correct timecodes, the timecodes in raw.avi will be who knows what. Take this into consideration when inserting subtitles.
Very quick'n'dirty way to make WIP encode (no logo, no subtitles)
dumpconvert --video-width=640 --video-height=400 --video-framerate=auto --output-oggenc=audio.ogg,quality=3 --output-x264=video.mkv,crf=20 --output-timecodev2=times.txt --video-max-dedup=29 dump.jmd
mkvmerge --aspect-ratio=1:4/3 --timecodes=1:times.txt -o wipencode.mkv video.mkv audio.ogg
Streamtools errata:
- --output-x264 does not appear to work with stock x264 on Windows. It does work with direct264 on Windows and stock x264 on Linux (and presumably other unix-like systems).
- letterbox rescaler can use odd offsets, leading to problems with chroma subsampling (letterbox2 forces offsets to be even)
- Pre-compiled version does not have letterbox2.
This is for producing stuff for further encoding (see the encoding guide). Thus advanced features like logo insertion, subtitling are not covered here.