switched to opencv2 for avi recording. code cleanup required