updated ffmpeg implementation