Fixed high CPU usage in FFmpeg