refine ffmepg and encoder, extract ffmpeg.