updated script to encode video from png