ffmpeg: better error handling