FFMpeg錄屏, avcodec_open2 返回 -1

出錯部分代碼

nRet = avcodec_open2(m_pAVEncodeCtx, pEncoder, nullptr);
if (nRet < 0)
{
	XXLOG->writeErrorInfo("錄製屏幕 - 打開編碼器失敗");
	YHLOG->writeErrorInfo(QString("Error-- id: %1. code: %2").
		arg(pEncoder->id).arg(nRet).toStdString());
    qDebug() << "Can not open encoder id: " << pEncoder->id << "error code: " << nRet;
    return -1;
}

avcodec_open2返回 -1

-在部分開發人員電腦中錄屏正常,

-在新安裝的虛擬機, 部分非開發環境電腦均不能錄製

經過…一系列折騰,

後面下載最新的FFMpeg的dll, 即可錄製
‘ffmpeg-20190202-6dc06e9-win32-shared.zip’
https://ffmpeg.zeranoe.com/builds/win32/shared/
Bug?

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章