working version with orientation output and video writer in mjpg format, emailed to kakani
