ffmpeg, demux, avformt_find_stream_info,解决卡住的问题
2015-01-31 18:13
330 查看
用ffmpeg做demux,网上很多参考文章。对于网络流,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;
}
...............
用ffmpeg做demux,网上很多参考文章。对于网络流,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;
}
...............
相关文章推荐
- avformat_find_stream_info函数卡住问题
- 解决 ffmpeg 在avformat_find_stream_info执行时间太长
- 解决 ffmpeg 在avformat_find_stream_info执行时间太长
- 针对ffmpeg做rtsp客户端时,avformat_find_stream_info长时间等待问题
- avformat_find_stream_info函数卡住问题
- ffmpeg 视频解码 vformat_find_stream_info() 后获取视频分辨率错误问题
- 解决 ffmpeg 在avformat_find_stream_info执行时间太长
- ffmpeg源码简析(七)解码-avformat_open_input,avformat_find_stream_info()
- FFmpeg函数avformat_find_stream_info()
- FFmpeg源代码简单分析:avformat_find_stream_info()
- EasyPlayerPro(Windows)开发系列之解决ffmpeg接口调用卡住的问题
- FFmpeg(4)-使用avformat_find_stream_info()来探测获取封装格式的上下文信息
- 解决“AndroidStudio导入项目在 Building ‘***’ gradle project info 一直卡住”的问题
- 【非程序问题】building gradle project info一直卡住的解决方法
- 问题集录--Android:解决Studio新建项目时,在 Building gradle project info 一直卡住
- Maven在[INFO] Generating project in Interactive mode卡住的问题解决
- ffmpeg源码跟踪笔记之avformat_find_stream_info
- 图解FFMPEG打开媒体的函数avformat_open_input&avformat_find_stream_info
- FFmpeg avformat_find_stream_info函数优化
- FFmpeg函数简单分析:avformat_find_stream_info()