场景
调用sws_getContext提示出错:Assertion desc failed at srcbswscale/swscale_internal.h:670
相关代码
sws_getContext(m_pCodecCtx->width, m_pCodecCtx->height, m_pCodecCtx->pix_fmt, m_pCodecCtx->width, m_pCodecCtx->height, AV_PIX_FMT_RGB32, SWS_BICUBIC, NULL, NULL, NULL);
解决
发现width,height参数分别为800和600,说明视频参数正常,然后怀疑是AV_PIX_FMT_RGB32无法转换,最后定位到m_pCodecCtx->pix_fmt的值是-1,这就是问题所在,通过修复解决