Do cleanup with FFmpeg API