Debugged in linux, can open and multiple video files and closes down neatly. Had to change optimization to O2, because otherwise I got segmentation faults