move swscale out of main thread