報錯:
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;
}
增加編譯參數(shù) rtc_use_h264=true 不管用!
修改 ffmpeg_generated.gni
找到third_party/ffmpeg/ffmpeg_generated.gni
use_linux_config婉支,添加 || is_android以支持鸯隅,結(jié)果如下
use_linux_config = is_linux || is_fuchsia || is_android
增加 codec_list parser_list h264 支持
修改 arm64
, 相應(yīng)的armv7的改相應(yīng)目錄即可
chromium/config/Chrome/android/arm64/config.h 中 CONFIG_H264_DECODER 設(shè)置為 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,
編譯參數(shù)添加 rtc_use_h264=true ffmpeg_branding="Chrome"