small function to cut and encode videos in webm