Added workaround for weird ffmpeg behavior, where we cannot reliably
determine the frame count