better handling of ffmpeg