Added AVI recording functionality