Fix AVI encoding, update example