FFmpeg
来源:互联网 发布:帝国竞争算法程序 编辑:程序博客网 时间:2024/06/06 20:59
FFmpeg old version, We initialize AVCodecContext often use the follow code.
But, in the FFmpeg new version, the streams->codec
code be declared attribute_deprecated
, it is suggest not to use the follow code.
AVCodecContext * pCodecCtx = pFormatCtx->streams[videoIndex]->codec;AVCodec * pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
How should we do?
The avcodec_open2
method’s document advice to use avcodec_alloc_context3()
method.
The document is introduced in detail how should we do.
But, it missing a method. It is avcodec_parameters_to_context()
method.
AVCodec *pCodec = avcodec_find_decoder(pFormatCtx->streams[videoIndex]->codecpar->codec_id);AVCodecContext *pCodecCtx = avcodec_alloc_context3(pCodec);avcodec_parameters_to_context(pCodecCtx, pFormatCtx->streams[videoIndex]->codecpar);if (avcodec_open2(pCodecCtx, pCodec, NULL) < 0) { printf("Could not open codec.\n"); return -1;}
0 0
- FFmpeg
- FFMPEG
- ffmpeg
- ffmpeg
- ffmpeg
- FFmpeg
- ffmpeg
- ffmpeg
- ffmpeg
- ffmpeg
- FFmpeg
- ffmpeg
- ffmpeg
- ffmpeg
- ffmpeg
- ffmpeg
- FFMPEG
- ffmpeg
- jffs2文件系统镜像挂载到Ubuntu
- 【Web】JAVAScript之函数
- Go 语言开发环境(Sublime Text+GoSublime)的配置
- HDU1839
- vs2015中文专业版激活秘钥
- FFmpeg
- 算法——排序
- W3C Schema复杂类型一
- ZOJ 3254
- HDU 5692 Snacks (dfs序+线段树)好题!
- ajax跨域请求的解决办法
- JavaScript 1.5 运算符
- 通过反射获取系统中所有继承了某接口的类
- 重新打包apk问题:jarsigner: 无法打开 jar 文件: