Q: AVI recording doesn't seem to work.
A: AVI recording is not the best way to record images, and it's quite complicated to implement (dealing with media libraries like ffmpeg, compiling the right codec support, and dealing with performances), so right now there is a very minimal support provided by OpenCV. It's likely that AVI support will be entirely removed in one of the next releases. You should always choose SER (which is basically RAW) for recording videos:
SER is supported by the most popular preprocessing and processing tools: I personally recommend PIPP for preprocessing, and Autostakkert for stacking. AVI has the only advantage of producing smaller files (but remember, you pay this by loosing quality). You can still compress a SER file anyway for archiving, or, if you really want an AVI, use a third party application like PIPP to convert the files.