1 回答

TA貢獻(xiàn)2021條經(jīng)驗(yàn) 獲得超8個(gè)贊
對(duì)于網(wǎng)絡(luò)流,avformt_find_stream_info()函數(shù)默認(rèn)需要花費(fèi)較長(zhǎng)的時(shí)間進(jìn)行流格式探測(cè),
那么,如何減少探測(cè)時(shí)間內(nèi)? 可以通過(guò)設(shè)置AVFotmatContext的probesize和max_analyze_duration屬性進(jìn)行調(diào)節(jié):
.............
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 關(guān)注
- 1792 瀏覽
添加回答
舉報(bào)