View Page Source

Revision (current)
Last Updated by adelikat on 11/15/2021 12:51 AM
Back to Page

!!!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 [https://files.tasvideos.org/emulatordownloads/jpcrr/streamtools-r11.7a.7z|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 [EncodingGuide|the encoding guide]). Thus advanced features like logo insertion, subtitling are not covered here.