[EDIT]
I moved posts from a couple of existing threads into this thread.
This weekend, I worked a little on Mupen64 AVI recording code, and as a result, portions of it were rewritten -- affecting even the vcr_compress API.
http://bisqwit.iki.fi/src/mupen64-vcr-patch2-bisqwit.txt
= source code patch, applies to code extracted from mupen64_src-rerecording-v8.7z (after converting CRLFs into LFs)
The change introduces my custom perfect noiseless A/V sync into the AVI recording mechanism by duplicating/dropping video frames as explained earlier.
It also incorporates a lanczos audio and video scaler.
However, it is incomplete!
1. I have not tried to compile it yet, because I have no access to a Windows computer here.
2. The Windows AVI recording dialog needs to be changed a bit. I cannot do this because I lack Windows programming experience.
- The AVI recording dialog should ask two extra questions: desired video resolution, and desired audio sampling rate.
If the desired video resolution differs from the size the game is rendered at, the video will be scaled using a lanczos scaler before saving into the AVI. Examples speaking in favor of this option have been posted earlier in this thread.
And it should ask the desired audio sampling rate. The emulator will use a lanczos scaler to resample the game's outputted audio into the target rate, and will do that reliably even if the rate changes in the middle of game. The lanczos scaler has better quality than the linear sampler that there was before.
The changed API also supports implementing encoders into formats that allow changing the video resolution during recording, and formats that allow changing the audio rate during recording.
I repeat, this is unfinished code and help is needed to finish it.
A breakdown of the changes in this patch:
* Makefile: Added a rule for vcr.o, removed vcr_resample.o from the linkage list
* config.h: Added VCR_SUPPORT as default, because the code doesn't even compile without it
* main_gtk.c: Fixed an error
* nesvideos_piece.*: Removed obsolete files
* vcr.c: Renamed into vcr.cpp
* vcr.cpp: Added a lanczos rescaler, a perfect A/V sync and decreased the number of global variables
* vcr.h: Removed non-op function "invalidatedCaptureFrame"
* vcr_compress.c*: The semantics of VCRComp_startFile() have changed, updated the files to match it; added also stubs for two notify functions.
* vcr_compress.h: Added new functions, changed some, added documentation
* vcr_resample.*: Removed obsolete files
* main_win.c: Removed mention of non-op "invalidatedCaptureFrame"
* Makefile.win: Removed linkage of vcr_recompress.*, updated rules for vcr.c*
* mupen64.dev: Removed mention of nesvideos-piece.h