after massive amount of hacking, first version which can dump frames from video into correct jpeg pictures