1 回答

寶慕林4294392
TA貢獻2021條經驗 獲得超8個贊
對于網絡流,avformt_find_stream_info()函數默認需要花費較長的時間進行流格式探測,
那么,如何減少探測時間內? 可以通過設置AVFotmatContext的probesize和max_analyze_duration屬性進行調節:
.............
if (avformat_open_input(&(handle->pFormatContext), "", handle->pInputFormat, NULL) < 0) {
av_free(handle->inputBuffer);
*errorCode = -4;
return FALSE;
}
(handle->fpState)(handle, 51);
AVDictionary* pOptions = NULL;
handle->pFormatContext->probesize = 100 *1024;
handle->pFormatContext->max_analyze_duration = 5 * AV_TIME_BASE;
if (avformat_find_stream_info(handle->pFormatContext, &pOptions) < 0) {
.........
return FALSE;
}
- 1 回答
- 0 關注
- 1795 瀏覽
添加回答
舉報
0/150
提交
取消