Encoding and Merging the videos