development based on ffmpeg code