Encoding
After following the procedure described in the
Dolphin video dumping guide it will have created several files in the dump directory of your Dolphin folder. This guide aims to provide you with information on how these files should be handled for encoding and differentiates between Windows and Linux versions of the AVhack.
General
Audio should be encoded at the sampling rate that requires the least amount of audio to be resampled. This should be 32kHz. An exception is encoding to Opus, whose encoder automatically resamples to 48kHz (this
might change in the future). In that case it is advisable to resample audio manually using a high quality resampler like the one
sox provides.
TODO: Add/explain formula for calculating the accurate FPS (it is here: http://codepad.org/HKorMEoH for now)
Windows
First take a look at \User\Dump\Audio. Out of the four files it contains (audiodump.wav, dspdump0-2.wav) only the latter three are needed. dspdump0.wav and dspdump2.wav are both 32kHz whereas dspdump1.wav is 48kHz. Resample that file to 32kHz and concatenate them subsequently:
sox dspdump0.wav dspdump1.wav dspdump2.wav <outfile_concat>
outfile_concat now contains a proper audiodump of the movie. It is also possible to concatenate them on the fly with Avisynth. (
TODO: Add the code snippet for this.)
Afterwards examine \User\Dump\Frames. It contains two files: framedump0.avi and timecodes.txt. framedump0.avi holds the lossless video dump as VFR (variable framerate) video and timecodes.txt the associated
timecodes in v2 format. Assuming you are using Avisynth for processing the video before inputting it to an encoding frontend, you now have to apply the timecodes to the video file and mux the resulting clip with the audio. To following code snippet is to be prepended to the respective .avs:
LoadCPlugin("timecodefps.dll")
video = AVISource("videofile.avi").TimecodeFPS("timecodes.txt", fpsnum=X, fpsden=Y)
audio = WAVSource("audiofile.wav")
AudioDub(video,audio)
Info: Above code requires
natt's VFR-to-CFR-conversion plugin; alternatively you may use
Aktan's plugin, which tolerates missing or spare timecodes. X and Y denote the desired CFR video FPS,
TODO: Explain Pipedec usage
Linux
Every file you need resides in $HOME/.dolphin-emu/Dump/Frames: framedump0.avi (lossless VFR video encoded with FFV1), framedump.txt (v2 timecodes), framedump0.raw and framedump1.raw (both audio). Audio is stored to disk as 16-bit, 2-channel, 32kHz, big endian raw audio (corresponds to ffmpeg format "s16be"). You likely want to convert it into something more suitable using e.g. ffmpeg:
ffmpeg -f s16be -channels 2 -ar 32000 -i framedump0.raw -c:a pcm_s16le audio.wav
Edit: This post is under construction. The dumping guide has been moved to the wiki:
http://tasvideos.org/EncodingGuide/VideoDumping.html#Dolphin. The encoding guide will soon be corrected and differentiate between Windows and Linux versions of the AVhack.