WEbRTC Android FFmpeg软解报错 H264解码找不到

报错:

  const AVCodec* codec = avcodec_find_decoder(av_context_->codec_id);
  if (!codec) {
    // This is an indication that FFmpeg has not been initialized or it has not
    // been compiled/initialized with the correct set of codecs.
    RTC_LOG(LS_ERROR) << "FFmpeg H.264 decoder not found.";
    Release();
    ReportError();
    return false;
  }

增加编译参数 rtc_use_h264=true 不管用!

修改 ffmpeg_generated.gni

找到third_party/ffmpeg/ffmpeg_generated.gni
use_linux_config,添加 || is_android以支持,结果如下

use_linux_config = is_linux || is_fuchsia || is_android

增加 codec_list parser_list h264 支持

修改 arm64, 相应的armv7的改相应目录即可

chromium/config/Chrome/android/arm64/config.h 中 CONFIG_H264_DECODER 设置为 1
third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavcodec/parser_list.c 添加 &ff_h264_parser,
third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavcodec/codec_list.c 添加 &ff_h264_decoder,

编译参数添加 rtc_use_h264=true ffmpeg_branding="Chrome"

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 通过webrtc的研究,webrtc中默认只支持了VP8,VP9两种软编解码方式,不过硬编解码,可以支持h264,...
    阿呆_e66a阅读 3,764评论 0 3
  • webrtc本身自带VP8,VP9的编解码器, google主推VP8,VP9,随着webrtc发展,webrtc...
    阿呆_e66a阅读 2,791评论 0 0
  • action_pool_depthCurrent value (from the default) = -1Fro...
    itcayman阅读 1,980评论 0 0
  • h264转视频编解码上还是有所优势,因为x264不支持视频分层,所以优先选择了openh264。 windows上...
    shuinan阅读 2,731评论 0 1
  • 一、引言 众所周知,Chrome/WebRTC中的视频编解码器一直使用Google自己开发的VP8/VP9,而对于...
    weizhenwei阅读 30,431评论 9 26