private void prepareFilters() { // only convert if needed if (stream->codec->pix_fmt == AVPixelFormat.AV_PIX_FMT_YUV420P) { convert = false; return; } // 1 = SWS_FAST_BILINEAR // https://www.ffmpeg.org/doxygen/3.1/swscale_8h_source.html#l00056 convCtx = ffmpeg.sws_getContext(stream->codec->width, stream->codec->height, stream->codec->pix_fmt, stream->codec->width, stream->codec->height, AVPixelFormat.AV_PIX_FMT_YUV420P, 1, null, null, null); }