原文链接:FFmpeg被声明为已否决情况整理

在VS2019编译ffmpeg时找不到av_register_all等相关函数定义,网上查了很多都是说extern "C"的问题,但我的extern "C"写得没问题,终于找到了一篇文章能够解决这个问题,转载一下备份。将旧版本相关代码复制为新版本的就可以了。

1、AVStream::codec': 被声明为已否决(类型)
旧版本:
if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO){
新版本:
if(pFormatCtx->streams[i]->codecpar->codec_type==AVMEDIA_TYPE_VIDEO){
2、AVStream::codec 被声明为已否决(内容)
旧版本:
pCodecCtx = pFormatCtx->streams[videoIndex]->codec;
新版本:
pCodecCtx = avcodec_alloc_context3(NULL);  
if (pCodecCtx == NULL)  
{  
  printf("Could not allocate AVCodecContext \n");  
  return -1;  
}  
 if (pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
  printf("Couldn't find audio stream information \n");
  return -1;
}
avcodec_parameters_to_context(pCodecCtx, pFormatCtx->streams[videoIndex]->codecpar);  
3、'avpicture_get_size': 被声明为已否决
旧版本:
avpicture_get_size(AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height)
新版本:
#include "libavutil/imgutils.h"
av_image_get_buffer_size(AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height, 1)
4、'avpicture_fill': 被声明为已否决
旧版本:
avpicture_fill((AVPicture *)pFrameYUV, out_buffer, AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height);
新版本:
av_image_fill_arrays(pFrameYUV->data, pFrameYUV->linesize, out_buffer, AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height, 1);
5、'avcodec_decode_video2': 被声明为已否决
旧版本:
ret = avcodec_decode_video2(pCodecCtx, pFrame, &got_picture, packet); 
新版本:
if(avcodec_send_packet(pCodecCtx, packet)<0 || (got_picture =avcodec_receive_frame(pCodecCtx, pFrame))<0)       {return -1}
6、' avcodec_alloc_frame': 被声明为已否决
旧版本:
pFrame = avcodec_alloc_frame();
新版本:
pFrame = av_frame_alloc();
7、'av_free_packet': 被声明为已否决
旧版本:
av_free_packet(packet);
新版本:
av_packet_unref(packet);

8、avcodec_decode_audio4:被声明为已否决
旧版本:
int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_frame, const AVPacket *avpkt);
新版本:
if(avcodec_send_packet(pCodecCtxOut_Video, &pkt)<0 || (got_frame=avcodec_receive_frame(pCodecCtxOut_Video,picture))<0) {return -1}

9、avcodec_encode_video2:被声明为已否决

旧版本:

iif(avcodec_encode_video2(tmpAvCodecCtx, &pkt, picture, &got_picture)<0)

新版本:
if(avcodec_send_frame(tmpAvCodecCtx, picture)<0 || (got_picture=avcodec_receive_packet(tmpAvCodecCtx, &pkt))<0)

10、avcodec_encode_audio2:被声明为已否决

旧版本:

if (avcodec_encode_audio2(tmpAvCodecCtx, &pkt_out, frame, &got_picture) < 0)

新版本:
if(avcodec_send_frame(tmpAvCodecCtx, frame)<0 || (got_picture=avcodec_receive_packet(tmpAvCodecCtx, &pkt_out))<0)

防止原文找不到转载了文章,附上
原文链接:FFmpeg被声明为已否决情况整理_大浪淘沙胡的博客-CSDN博客

undefined reference to `av_register_all‘ 相关问题 FFmpeg被声明为已否决情况相关推荐

  1. FFmpeg被声明为已否决情况整理

    1.AVStream::codec': 被声明为已否决(类型) 旧版本: if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_ ...

  2. FFmpeg被声明为已否决的解决方案

    FFmpeg被声明为已否决的解决方案 参考文章: (1)FFmpeg被声明为已否决的解决方案 (2)https://www.cnblogs.com/lgh1992314/p/5834634.html ...

  3. FFmpeg —— “被声明为已否决” - 集合

    说明      这里暂且记录本人在FFmpeg开发过程中遇到的"被声明为已否决"的一部分集合.有可能记录不全,但后面若是碰到类似情况,会继续更新的.      另外,为什么会出现这 ...

  4. VS使用FFmpeg被声明为已否决的解决方案

    原因 FFmpeg中所谓的"被声明为已否决"就是因为函数或者结构体属性被标示为attribute_deprecated,很有可能在未来的版本中就删除了. 解决方法 所以我们最好的解 ...

  5. ffmpeg avstream::codec 被声明为已否决

    ffmpeg avstream::codec 被声明为已否决 之前的版本 pCodecCtx = pFormatCtx->streams[videoIndex]->codec; 之后的版本 ...

  6. 错误 ‘av_free_packet‘: 被声明为已否决 FFmpeg

    'av_free_packet': 被声明为已否决 FFmpegInterop d:\ffmpeginterop\ffmpeginterop\source\ffmpegreader.cpp 63 注意 ...

  7. ffmpeg 静态库使用,undefined reference错误

    转载自:https://blog.csdn.net/bobsweetie/article/details/50933605 最近研究ffmpeg的时候遇到不少问题,我的系统环境ubuntu12.04, ...

  8. 【FFMPEG】【ARM-Linux开发】 ffmpeg 静态库使用,undefined reference错误

    原文:http://blog.csdn.net/chinazjn/article/details/7954984 ffmpeg移植到dm365上,遇到undefined reference错误: GA ...

  9. 解决编译FFmpeg 出现undefined reference to `truncf‘的问题

    前言:之前编译过FFmpeg,遇到过这个问题,机缘巧合的解决了,最近换了一个版本重新编译的时候又遇到了这个问题,想了很久才想起来,所以在这里记录一下 项目场景: 编译FFmpeg 问题描述: 提示 u ...

最新文章

  1. 通用权限管理系统组件 中集成多个子系统的单点登录(网站入口方式)附源码
  2. java中有没有栈_Java中堆和栈有什么区别
  3. (转)SSL/TLS 漏洞“受戒礼”,RC4算法关闭
  4. 比特币黄金首遭“51%攻击”,可能动摇数字货币世界的根基
  5. 获取的官方例程后怎么开发_开发商败诉后拒不赔偿怎么办,房地产纠纷处理方式有哪些?...
  6. mysql 中模糊查询的四种用法介绍
  7. ios raise_如何在iOS 10中关闭“ Raise to Wake”
  8. mysql mgr CONSuL_Mysql MGR + Consul + Consul-template + Haproxy 搭建mysql 高可用集群 (三)...
  9. 7.1 pdo 宝塔面板php_宝塔面板PHP7.2 安装mcrypt扩展
  10. L2-004. 这是二叉搜索树吗?-PAT团体程序设计天梯赛GPLT
  11. dialog能提交数据吗_硬盘坏了能恢复数据吗?实用硬盘修复软件
  12. Top 10 Security Issue Solution
  13. java放大镜怎么写,JavaScript简单实现放大镜效果代码
  14. php 常见的视频格式转换
  15. 小精灵无尽的长廊_绝顶高手的养成日常
  16. 推荐一款HTML在线编辑器
  17. 国内云桌面架构有哪些?为什么VDI能成为主流
  18. 微信小程序 录像 录视频
  19. 100道iOS面试题
  20. 桌面级与企业级硬盘的区别

热门文章

  1. 百度快照回档只为何?
  2. 红警ol服务器维护中1003,7月23日停服更新公告
  3. android 退出登录通知到每个界面,文档中心 | QuickSDK——专业的手游第三方SDK接入服务平台,渠道SDK聚合,广告跟踪,客服,登录充值SDK...
  4. Centos7 上 用crontab 实现php计划任务
  5. 帮帮忙!!!!!!!
  6. SQLMap中文参数用户手册
  7. onclick在html中重置,onclick在html中如何使用
  8. adb inputswipe shell_android adb shell input各种妙用
  9. DNS服务器的搭建(反向解析)
  10. ESXi 6.5 503 Service Unavailable