chromium 33 视频编解码

01 基本资料

官网关于视频编解码的文档,

chromium/src/media: https://chromium.googlesource.com/chromium/src/media/
audio-video: https://www.chromium.org/audio-video
media playback: https://www.chromium.org/developers/design-documents/video
https://chromium.googlesource.com/chromium/src/+/refs/heads/master/media/README.md

中文博客
修改Chromium源码,实现HEVC/H.265 4K视频播放

Chromium源码–视频播放流程分析(WebMediaPlayerImpl解析)

使用 chrome://media-internals/ 分析播放内容

02 相关代码位置

# Chromium
media/ - Home to all things media!
media/audio - OS audio input/output abstractions
media/video/capture - OS camera input abstraction
media/video - software/hardware video decoder interfaces + implementations
third_party/ffmpeg - Chromium's copy of FFmpeg
third_party/libvpx - Chromium's copy of libvpx

# Blink
# src\third_party\blink\renderer\core\html\media
third_party/blink/renderer/core/html/media/html_media_element.{cpp,h,idl} - media element base class
third_party/blink/renderer/core/html/media/html_audio_element.{cpp,h,idl} - audio element implementation
third_party/blink/renderer/core/html/media/html_video_element.{cpp,h,idl} - video element implementation

# Particularly Interesting Bits
media/base/mime_util.cc - defines canPlayType() behaviour and file extension mapping
media/blink/buffered_data_source.{cc,h} - Chromium's main implementation of DataSource for the media pipeline
media/blink/buffered_resource_loader.{cc,h} - Implements the sliding window buffering strategy (see below)
third_party/blink/public/platform/web_media_player.h - Blink's media player interface for providing HTML5 audio/video functionality
media/blink/webmediaplayer_impl.{cc,h} - Chromium's main implementation of WebMediaPlayer

03 编解码器支持格式

# Container formats
MP4 (QuickTime/ MOV / MPEG4)
Ogg
WebM
WAV
HLS [Only on Android and only single-origin manifests]
Codec formats (Decode Only)

# Audio
FLAC
MP3
Opus
PCM 8-bit unsigned integer
PCM 16-bit signed integer little endian
PCM 32-bit float little endian
PCM μ-law
Vorbis
AAC [Main, LC, HE profiles only, xHE-AAC on Android P+] [Google Chrome only]
AMR-NB [Google Chrome OS only]
AMR-WB [Google Chrome OS only]
GSM [Google Chrome OS Only]

# Video
VP8
VP9
AV1 [Only Chrome OS, Linux, macOS, and Windows at present]
Theora [Except on Android variants]
H.264 [Google Chrome only]
H.265 [Google Chrome OS on Intel Gen 11-based Chromebooks for protected content playback only]
MPEG-4 [Google Chrome OS only]

04 启动 ffmpeg

设置标志位:
ffmpeg_branding=true
proprietary_codecs=true

# 比如:
gn gen out/Debug --ide=vs2019 --args="target_os=\"win\" target_cpu=\"x86\" is_component_build=true is_debug=true is_official_build=false google_api_key=false google_default_client_id=false google_default_client_secret=false proprietary_codecs=true media_use_ffmpeg=true ffmpeg_branding=\"Chrome\" enable_nacl=false enable_mse_mpeg2ts_stream_parser=true enable_hls_sample_aes=true enable_platform_hevc=true chrome_pgo_phase=0"

05 官网提供的流程图

chromium 33 视频编解码_第1张图片

chromium 33 视频编解码_第2张图片
chromium 33 视频编解码_第3张图片

你可能感兴趣的:(chromium,chromium)