numberwolf/h265web.js

🔥 作者:常炎隆(Author: ChangYanlong):HEVC/H.265 网页直播/点播播放器 支持硬解! 支持H.265的HttpFLV/HLS/MP4/TS/FLV/M3U8/Websocket/WebRTC播放。 🔥 A HEVC/H.265 Web Player, Support hard-decoding! for LIVE/VOD stream. Support H.265 Codec with HttpFLV/HLS/MP4/TS/FLV/M3U8/Websocket/WebRTC.

2,341

stars

306

commits

JavaScript

primary language

Aug 24, 2026

updated

h265web.com
1080p
h265
h265-player
hard-decoding
hevc
hls
http-flv
httpflv
live
m3u8
mp4
player
rtc
simd
wasm
web
webcodec
webrtc
websocket
Browse cluster: Live Media Streaming & RTMP/RTSP Servers

README

h265web.js - Browser HEVC/H.265 Playback SDK

中文 · English

h265web.js logo     h265web.js demo preview

Website Public Demo GitHub Docs Docs Local

Built and refined continuously since 2017, h265web.js PRO delivers mature browser playback with broad feature coverage and strong performance.

It covers HEVC/H.265, AVC/H.264, AV1, WebRTC, live streaming, VOD, WebCodec, WASM decoding, MediaInfo, snapshot, fullscreen, seek and multi-instance playback.

Recommended media server: ZLMediaKit - a strong streaming server/framework for live and VOD delivery.

If h265web.js helps your project, giving it a GitHub star is a simple way to support the work and help more developers discover it.

Contact

Demo Entry

Good Fit For

  • Browser playback of HEVC/H.265, AVC/H.264 and AV1
  • VOD and live playback in one SDK
  • Protocol validation for MP4 / MOV / MKV / FLV / MPEG-TS / M3U8 / HLS / HTTP-FLV / WS-FLV / HTTP-TS / WS-TS / WebRTC / HEVC ES
  • Browser-side player projects that need seek, playbackRate, fullscreen, snapshot, MediaInfo, multi-instance playback and multi-thread decode

Integration Cases (Partial)

TemuKwaiiQiYiBaiduBaidu CloudBeijing Shutong MofangHangzhou Chengzhi TianyangNanjing Yiyi
TemuKwaiiQiYiBaiduBaidu CloudBeijing Shutong MofangHangzhou Chengzhi TianyangNanjing Yiyi








Shandong WorldShanghai UnicomXi'an Sihua




Shandong WorldShanghai UnicomXi'an Sihua




Feature Matrix

FeatureFeatureFeatureFeature
HLS(LIVE)M3u8(VOD)MP4(VOD)FLV(VOD)




HTTP-FLV(LIVE)HTTP-TS(LIVE)WS-FLV(LIVE)WS-TS(LIVE)




MPEG-TS(VOD)MPEG-PS(VOD)AV1(Chrome)MOV(H.265)





HTTP-HEVCWS-HEVCMKV(HEVC)AAC(MAIN/LC)




Multi-Thread
(only:
https+nginx conf)
Single-ThreadG711A(HTTP-FLV)G711U(HTTP-FLV)




MediaInfoHEVC/H.265AVC/H.264Hardware decoder
(FLV/HTTP-FLV/MP4)







WebRTC(LIVE)


h265web.jsmpeg.js (ts demuxer)h265web.js's H.265 decoderLICENSE
h265web.jsMPEG-Demuxer.jsh265web.js-wasm-decoderCYL_Free-1.0 LICENSE-Free_CN.MD

Feature Support

Supported

  • Protocol box
protocolmodelsupportdesc
mp4Video on demandY----
movVideo on demandYHEVC/H.265
mkvVideo on demandYHEVC/H.265
av1Video on demandYChrome
mpeg-tsVideo on demandY----
mpeg-psVideo on demandY----
m3u8Video on demandY----
hlsLiveY----
flvVideo on demandY----
http-flvLiveYCodecID=12
http-tsLiveY----
http-hevcLiveY----
http-hevcVideo on demandY----
websocket-hevcLiveY----
websocket-flvLiveY----
websocket-tsLiveY----
WebRTC / WHEPLiveYStandard HTTP signaling endpoint; recommended for playback
webrtc://LiveYSDK-compatible URL converted to WHEP signaling
ZLM WebRTC APILiveYZLMediaKit private signaling endpoint
HEVC/H.265Video on demandY----
HEVC/H.265LiveY----
AVC/H.264Video on demandY----
AVC/H.264LiveY----
  • Codec
CodecSupportDesc
AVC/H.264Y----
HEVC/H.265Y----
AACY----
G711AYHTTP-FLV
G711UYHTTP-FLV
AV1YChrome
  • Features
FeatureSupportDesc
Hardware-DecodeYFor Chrome/Safari etc...
WebCodecYBrowser-supported hardware path
SIMDYWASM + SIMD acceleration path
MSEYBrowser MSE playback path
Native WebRTCYWHEP, webrtc:// compatibility URL and ZLM private signaling
WebRTC Auto RoutingYURL recognition in the SDK; core: 'webrtc' can force the route
WebRTC Partial A/VYSupports AV, video-only and audio-only negotiated results
Video on demandY----
LiveY----
SeekY----
AccurateSeekY----
Cover ImageY----
Playing with downloadY----
VolumeY----
PlayY----
PauseY----
ReStartY----
PauseWithCoverImageY----
1080PY----
720PY----
Create multi playersY----
Play without AudioY----
Cache processY----
Open FullscreenY----
Exit FullscreenY----
Play frame by frameY----
SnapshotY----
AutoplayYHTTP-FLV 265+264
HTTP-TS 265+264
HLS 264
Cache LengthYMP4 265
Multi-thread decoderY(HTTPS+ Conf NGINX)
Single-thread decoderYcompatible
Get MediaInfoY----
Get Codec ParamYVideo&Audio
Get Media DurationYVideo&Audio
Get Video SizeY----
Get Video FPSY----
Get Audio SampleRateY----
Chase FrameYHTTP-FLV(no audio)
PlayBackRateYH.264/H.265/AV1
ResizeY----
Get SEI DataY----

WebRTC Publish and Playback

WHIP is the standard WebRTC HTTP ingestion protocol, and WHEP is the standard WebRTC HTTP egress protocol. h265web.js is a player, so WHEP is the recommended playback input. The HTTP(S) endpoint carries SDP signaling; negotiated media still uses WebRTC ICE/DTLS/SRTP.

For ZLMediaKit RTMP-to-WebRTC conversion, set the timestamp policy before testing:

[protocol]
modify_stamp=1
paced_sender_ms=0

modify_stamp=1 uses the ZLMediaKit receive clock with smoothing. With modify_stamp=2, some H.264 + AAC RTMP inputs can continue decoding at the expected frame rate while Chrome drops late frames during native WebRTC playout.

The following command publishes the tested H.264 + AAC source to ZLMediaKit. ZLMediaKit then exposes it through WHEP:

ffmpeg -hide_banner -stream_loop -1 -re \
  -i /path/to/input.flv \
  -vf scale=640:360,format=yuv420p \
  -c:v libx264 -preset veryfast -tune zerolatency \
  -profile:v baseline -level 3.1 -bf 0 \
  -g 25 -keyint_min 25 -sc_threshold 0 \
  -c:a aac -profile:a aac_low -ar 44100 -ac 2 -b:a 128k \
  -f flv rtmp://127.0.0.1/live/test

Supported playback inputs for that stream:

http://127.0.0.1/index/api/whep?app=live&stream=test
webrtc://127.0.0.1/live/test
http://127.0.0.1/index/api/webrtc?app=live&stream=test&type=play

The first URL is standard WHEP and is recommended. webrtc:// is an SDK compatibility URL converted to WHEP. The third URL is specific to ZLMediaKit.

const player = H265webjsPlayer();

player.on_ready_show_done_callback = function () {
  console.log('WebRTC first frame ready');
};

player.on_play_time = function (seconds) {
  console.log('WebRTC play time', seconds);
};

player.on_error_callback = function (error) {
  console.error('WebRTC playback error', error);
};

player.build({
  player_id: 'canvas111',
  base_url: './static/',
  wasm_js_uri: 'h265web_wasm.js',
  wasm_wasm_uri: 'h265web_wasm.wasm',
  ext_src_js_uri: 'extjs.js',
  ext_wasm_js_uri: 'extwasm.js',
  width: 640,
  height: 360,
  auto_play: false,
  ignore_audio: false,
  core: 'webrtc'
});

player.load_media('http://127.0.0.1/index/api/whep?app=live&stream=test');

Omit core to let the SDK recognize the three WebRTC URL forms automatically. WebRTC uses the existing player lifecycle and callback names; no separate public API is required. Native WebRTC live playback stays at 1x and does not support seek. Standard WebRTC can only receive codecs negotiated by the browser. WebCodecs/WASM fallback for a non-negotiated codec requires the server to implement the optional h265web-rtc-encoded/v1 encoded-media transport.

Documentation

Partner Projects

About


Donate

WechatAlipayPayPal
-

FFmpegSupportH265LiveEncode


TranscodeAndGet265CodecFileByFFmpeg

  • mp4
ffmpeg -i input.mp4 \
-vcodec libx265 -pix_fmt \
-acodec aac -ac 2 -ar 44100 \
-preset medium -maxrate 1000k -bufsize 1000k \
-vtag hvc1 \
-movflags faststart \
-y video.mp4
  • hls/m3u8 capture
ffmpeg -f avfoundation -i 1:0 \
-q 4 -r 10 \
-filter_complex "scale=1280:720" \
-pix_fmt yuv420p \
-vcodec libx265 \
-ar 22050 -ab 64k -ac 1 -acodec aac \
-threads 4 \
-preset veryfast \
-f segment \
-segment_list test.m3u8 \
-segment_time 5 \
-y /Users/numberwolf/Documents/webroot/VideoMissile/VideoMissilePlayer/res/hls1/v-%03d.ts
  • mpeg-ts
ffmpeg -ss 20 -t 10 -i ./res/xinxiaomen.mp4 \
-vcodec libx265 -x265-params "bframes=0:keyint=10" -r 24 -filter_complex "scale=720:1280" -preset fast -maxrate 800k -bufsize 800k \
-acodec aac -ar 22050 -ac 1 \
-pix_fmt yuv420p \
-f mpegts -y ./res/veilside2.ts

UpdateLog

UpdateContent
Time2026/08/25
-0.Added native WebRTC live playback with standard WHEP signaling, webrtc:// compatibility URLs and the ZLMediaKit private WebRTC API
-1.Added automatic WebRTC URL routing and explicit core: 'webrtc' selection without changing the existing build() and load_media() API
-2.Added AV, video-only and audio-only negotiated playback, existing lifecycle/error callbacks, release/rebuild and multi-instance isolation
-3.Added WHIP publish and WHEP playback demos, plus real Chrome regression coverage for WHEP, MP4, HTTP-FLV and HTTP-TS
-4.Documented the ZLMediaKit modify_stamp=1 requirement for stable RTMP-to-WebRTC A/V timestamps
Time2026/08/10
-0.Added callback-aware HLS mainline routing across Native HLS, MSE, WebCodec and WASM; auto/mainline never enter past-core/ext*, while legacy must be selected explicitly
-1.Aligned callback contracts across HLS, MP4, FLV and MPEG-TS, including SEI, NAL/frame/render, cache, seek, lifecycle, GPU and A/V-sync callbacks
-2.Improved HLS master/media playlists, redirects, live sliding windows, discontinuities, codec detection, HEVC samples, keyframes and timestamp handling
-3.Strengthened seek completion, release/rebuild, worker cleanup, bounded release timeout and multi-instance isolation
-4.Clarified audio controls: ignore_audio skips the audio pipeline and is not mute; set_voice(0) can be restored with a positive volume
-5.Updated English/Chinese integration documentation and expanded automated and browser regression coverage
Time2026/08/03
-0.Optimized Auto core selection to prefer native/MSE, then WebCodec, then WASM/SIMD, with controlled fallback
-1.Improved H.264/H.265 playback with AAC, PCM, G.711A and G.711U audio; unsupported audio no longer downgrades a playable video core
-2.Fixed repeated backward jumps and frame skipping in HEVC B-frame HTTP-TS and WebSocket-TS live streams by normalizing only the detected abnormal live-TS DTS cadence while preserving CTS reorder information
-3.Improved player lifecycle cleanup, error fallback and multi-instance stability
Time2026/03/28
-0.Update more powerful version
Time2022/11/06
-0.Update
Time2022/11/02
-0.Update WASM
Time2022/10/22
-0.Support: Hard-Decode for FLV/HTTP-FLV/MP4
-1.Support: AVC with Mpeg-TS
Time2022/09/13
-0.Fixed: AVC stream loop buffer error without autoplay
Time2022/09/12
-0.Fixed: hevc url cannot play without text of "http"
Time2022/08/24
-0.Feature: Safari with native player(version>13)
Time2022/08/23
-0.Fixed: Buffer Progress with AVC
Time2022/08/13
-0.Support: Resize
Time2022/07/27
-0.Support: PlayBackRate
Time2022/07/12
-0.Fixed some problem
Time2022/07/06-10
-0.Support g711u (http-flv)
-1.Fixed: HTTP-FLV(AVC) without Audio
Time2022/07/01
-0.Feature: HTTP-FLV(Without audio) Stream Performance optimizing
Time2022/06/27
-0.Fixed: problem with hls parser
Time2022/06/26
-0.Support g711a (http-flv)
-1.Fixed 264(avc) flv error with mediainfo
-2.Support Multi/Single Thread
Time2022/05/18
-0.Support multi-thread decode
-1.Support mp4's cache length config
-2.Performance optimizing
-3.This version is for Beta
Time2022/05/09
-0.Suport play with Websocket 265 raw stream
Time2022/05/07
-0.Fixed:MP4(VOD) retry error
-1.Support:HEVC raw stream(VOD), create with url
-2.Support:MKV format
Time2022/04/21
-0.Performance optimizing
Time2022/04/17
-New Opensource Free Protocol CYL_Free-1.0 LICENSE-Free_CN.MD
Time2022/04/14
-0.Support Mov File
-1.Support HTTP-FLV/HTTP-TS/HLS Autoplay
-2.Performance optimizing of 1080P MP4(VOD)
-3.Retry of mp4 sniff action
-4.Support AV1
-5.Support Play frame by frame
-6.Support Video Frame Snapshot
Time2022/03/28
-0.Support MPEG-PS(MPEG1) stream
Time2022/03/02
-0.Fixed h264 FLV(LIVE) can not get resolution info with retry
Time2022/01/17
-0.Fixed ISSUE of HLS 265 OOM Case https://github.com/numberwolf/h265web.js/issues/108
-1.Fixed ISSUE of HLS Split Rules https://github.com/numberwolf/h265web.js/issues/105
-2.Add New Demo index-debug.html
-3.Fixed 10+playes of 264 play failed, stack overflow
Time2021/12/31
-0.Add H.264 HTTP-FLV Retry after error
Time2021/12/24
-0.Fixed H.264 HTTP-FLV Some Badcase with callback
Time2021/12/19
-0.Fixed H.264 HLS Callback's problem
Time2021/12/08
-0.Fixed Problem of H.264 MP4 onReadyShowDone Event
Time2021/12/04 - In the small hours
-0.Fixed http-flv 265 Render With crash
-1.Fixed hls problem of fullscreen
-2.Fixed some bugs
Time2021/11/29 - Night
-0.Fixed http-flv retry case and some bugs
Time2021/11/25 - Night
-0.Fixed httpflv/ws LIVE ignoreAudio problem
Time2021/11/23 - Night
-0.Fixed https://github.com/numberwolf/h265web.js/issues/90
Time2021/11/21 - In the small hours
-0.Support Websocket-FLV (HEVC/H.265)
-1.Support Websocket-TS (HEVC/H.265)
-2.Support HTTP-TS (HEVC/H.265)
Time2021/11/16 - Evening
-0.First request, if no response and timeout, then retry 5 times
Time2021/11/15 - Evening
-0.HTTP-FLV auto retry when timeout with out packet.(7s)
Time2021/11/14 - Evening
-0.Add wasm file of 265mb version(can memory auto grow)
-1.Add wasm file of 512mb version(can memory auto grow)
Time2021/11/04 - Evening
-0.Fixed: release many times with crash
Time2021/10/26 - Evening
-0.Fixed some bugs
Time2021/10/24 - Evening
-0.Support Codec of AVC/H.264's MP4/HLS/M3u8/FLV/HTTP-FLV play
Time2021/10/18 - Evening
-0.Add new example
Time2021/10/16 - Evening
-0.Fixed: HTTP-FLV: Mediainfo's codec fault value
-1.Update example
Time2021/10/14 - Evening
-0.Fixed: Mediainfo's codec fault value
Time2021/10/13 - Evening
-0.The player compatible with WebIDE develop, split wasm(js) and h265web.js, need include wasm(js) as single
Time2021/10/12 - Evening
-0.Fixed: Support HTTP-FLV(HEVC) without fps param
Time2021/10/09 - In the small hours
-0.Support HTTP-FLV(HEVC) LIVE, CodecID=12
-0.MP4/FLV(VOD) performance optimizing of Seek operation(out of cache area)
Time2021/09/27 - Evening
-0.M3u8/MpegTS performance optimizing of Seek operation(out of cache area)
Time2021/09/25 - In the small hours
-0.HLS Live Fixed: Crash by OOM
-1.HLS Live Fixed: MPEG-TS full path
-2.HLS Live Fixed: Stop by lost stream a moment
-3.HLS Live Fixed: Stop by unstable network
Time2021/09/08 - Evening
-0.Fixed: M3U8 Seek with Decode Failed
-1.Fixed: Some MP4 Case
-2.Config update, remove some options, make it auto set
Time2021/09/07 - Evening
-0.M3U8 Fixed: some error with parse mpegts file
Time2021/09/07 - In the small hours
-0.Bak Player Core - Fixed:MP4/FLV(VOD) Seek BUG can not seek to 0; And performance optimizing for play
Time2021/08/15
-0.H265/HEVC Upgrade Raw Data Player for VOD/LIVE
Time2021/07/18
-0.Upgrade: Player UI Style
-1.Support: fullscreen & close fullscreen
-2.Add Event: open/close fullscreen
Time2021/07/11
-0.Fixed: The player compatible with ZLMediaKit + HUAWEI HoloSens Camera LIVE Stream
Time2021/07/04
-0.Fixed: ISSUE#58 (When default player-core's status is caching-frames, can not pause video)
Time2021/07/01
-0.Add example and package.json file
Time2021/06/27
-0.Open Source!
-1.Support Seek in FLV
-2.Fixed: Seek problems with bak player core mode
-3.Add FLV type ,and do not need set player-core
Time2021/05/30
-1.Fixed: Some problem with seek and play(Important)
-2.Feature: Event/Callback of Video's cover image load finished
Time2021/05/24
-1.FLV VOD Play(In the bak player core mode)
Time2021/05/21
-1.HLS(LIVE:No audio)performance optimizing
Time2021/05/18
-1.HLS(LIVE) performance optimizing and add Audio
Time2021/05/16
-1.MP4(VOD) Fixed:BD265 Mp4 box badcase
Time2021/05/15
-1.Fixed: HLS Play(LIVE)
Time2021/04/27
-1.Fixed: Some video playing with gray block(mosic)
-2.Fixed: Some video when playing first gop with gray block(mosic)
Time2021/04/22
-1.Bak player core mode(test) support: seek
-2.Bak player core mode(test) support: yuvj420p
-3.Others
Time2021/04/12
-1.Fixed bug: Some video(encode hev) play failed
-2.Fixed bug: Some video(nalu unstandard) play failed
-3.Fixed bug: Some video play error with mosic
Time2021/04/07
-1.Fixed duration error
Time2021/03/28
-1.Add cache process event
-2.Fixed some bugs
-3.Remove HLS Log
-4.Play without audio optio(New Core)
Time2021/03/14
-1.Bak player core mode: Fixed: render of bytes align
Time2021/03/12
-1.Sorry my friends, I was too tired to make a mistake with hls feature... Now I have fixed it. _!
Time2021/03/06
-1.Bak player core mode, Fixed: multi-stream play badcase
Time2021/02/28
-1.Add function to feed 265 nalu-frame append265NaluFrame(nalBuf);
-2.Add new library to parse 265 stream raw-parser.js
Time2021/02/21
-1.New SDK Project for H.265/HEVC decoder - https://github.com/numberwolf/h265web.js-wasm-decoder
Time2021/02/18
-1.Bak player core mode support play with audio
Time2021/02/08
-1.Bak player core mode (beta version , do not support play audio and seek. Make your mp4's moov box front of the mdat)
Time2021/01/04
-1.Player Support Hevc file
-2.Player Support Hevc stream
-3.Remove Play/Pause Mask
-4.Add Event:onPlayFinish, called when play video finished

Contributors

numberwolf

229 commits

girlbymirror

65 commits

nonzzz

12 commits

numberwolf/h265web.js

🔥 作者:常炎隆(Author: ChangYanlong):HEVC/H.265 网页直播/点播播放器 支持硬解! 支持H.265的HttpFLV/HLS/MP4/TS/FLV/M3U8/Websocket/WebRTC播放。 🔥 A HEVC/H.265 Web Player, Support hard-decoding! for LIVE/VOD stream. Support H.265 Codec with HttpFLV/HLS/MP4/TS/FLV/M3U8/Websocket/WebRTC.

2,341

stars

306

commits

JavaScript

primary language

Aug 24, 2026

updated

h265web.com
1080p
h265
h265-player
hard-decoding
hevc
hls
http-flv
httpflv
live
m3u8
mp4
player
rtc
simd
wasm
web
webcodec
webrtc
websocket
Browse cluster: Live Media Streaming & RTMP/RTSP Servers

README

h265web.js - Browser HEVC/H.265 Playback SDK

中文 · English

h265web.js logo     h265web.js demo preview

Website Public Demo GitHub Docs Docs Local

Built and refined continuously since 2017, h265web.js PRO delivers mature browser playback with broad feature coverage and strong performance.

It covers HEVC/H.265, AVC/H.264, AV1, WebRTC, live streaming, VOD, WebCodec, WASM decoding, MediaInfo, snapshot, fullscreen, seek and multi-instance playback.

Recommended media server: ZLMediaKit - a strong streaming server/framework for live and VOD delivery.

If h265web.js helps your project, giving it a GitHub star is a simple way to support the work and help more developers discover it.

Contact

Demo Entry

Good Fit For

  • Browser playback of HEVC/H.265, AVC/H.264 and AV1
  • VOD and live playback in one SDK
  • Protocol validation for MP4 / MOV / MKV / FLV / MPEG-TS / M3U8 / HLS / HTTP-FLV / WS-FLV / HTTP-TS / WS-TS / WebRTC / HEVC ES
  • Browser-side player projects that need seek, playbackRate, fullscreen, snapshot, MediaInfo, multi-instance playback and multi-thread decode

Integration Cases (Partial)

TemuKwaiiQiYiBaiduBaidu CloudBeijing Shutong MofangHangzhou Chengzhi TianyangNanjing Yiyi
TemuKwaiiQiYiBaiduBaidu CloudBeijing Shutong MofangHangzhou Chengzhi TianyangNanjing Yiyi








Shandong WorldShanghai UnicomXi'an Sihua




Shandong WorldShanghai UnicomXi'an Sihua




Feature Matrix

FeatureFeatureFeatureFeature
HLS(LIVE)M3u8(VOD)MP4(VOD)FLV(VOD)




HTTP-FLV(LIVE)HTTP-TS(LIVE)WS-FLV(LIVE)WS-TS(LIVE)




MPEG-TS(VOD)MPEG-PS(VOD)AV1(Chrome)MOV(H.265)





HTTP-HEVCWS-HEVCMKV(HEVC)AAC(MAIN/LC)




Multi-Thread
(only:
https+nginx conf)
Single-ThreadG711A(HTTP-FLV)G711U(HTTP-FLV)




MediaInfoHEVC/H.265AVC/H.264Hardware decoder
(FLV/HTTP-FLV/MP4)







WebRTC(LIVE)


h265web.jsmpeg.js (ts demuxer)h265web.js's H.265 decoderLICENSE
h265web.jsMPEG-Demuxer.jsh265web.js-wasm-decoderCYL_Free-1.0 LICENSE-Free_CN.MD

Feature Support

Supported

  • Protocol box
protocolmodelsupportdesc
mp4Video on demandY----
movVideo on demandYHEVC/H.265
mkvVideo on demandYHEVC/H.265
av1Video on demandYChrome
mpeg-tsVideo on demandY----
mpeg-psVideo on demandY----
m3u8Video on demandY----
hlsLiveY----
flvVideo on demandY----
http-flvLiveYCodecID=12
http-tsLiveY----
http-hevcLiveY----
http-hevcVideo on demandY----
websocket-hevcLiveY----
websocket-flvLiveY----
websocket-tsLiveY----
WebRTC / WHEPLiveYStandard HTTP signaling endpoint; recommended for playback
webrtc://LiveYSDK-compatible URL converted to WHEP signaling
ZLM WebRTC APILiveYZLMediaKit private signaling endpoint
HEVC/H.265Video on demandY----
HEVC/H.265LiveY----
AVC/H.264Video on demandY----
AVC/H.264LiveY----
  • Codec
CodecSupportDesc
AVC/H.264Y----
HEVC/H.265Y----
AACY----
G711AYHTTP-FLV
G711UYHTTP-FLV
AV1YChrome
  • Features
FeatureSupportDesc
Hardware-DecodeYFor Chrome/Safari etc...
WebCodecYBrowser-supported hardware path
SIMDYWASM + SIMD acceleration path
MSEYBrowser MSE playback path
Native WebRTCYWHEP, webrtc:// compatibility URL and ZLM private signaling
WebRTC Auto RoutingYURL recognition in the SDK; core: 'webrtc' can force the route
WebRTC Partial A/VYSupports AV, video-only and audio-only negotiated results
Video on demandY----
LiveY----
SeekY----
AccurateSeekY----
Cover ImageY----
Playing with downloadY----
VolumeY----
PlayY----
PauseY----
ReStartY----
PauseWithCoverImageY----
1080PY----
720PY----
Create multi playersY----
Play without AudioY----
Cache processY----
Open FullscreenY----
Exit FullscreenY----
Play frame by frameY----
SnapshotY----
AutoplayYHTTP-FLV 265+264
HTTP-TS 265+264
HLS 264
Cache LengthYMP4 265
Multi-thread decoderY(HTTPS+ Conf NGINX)
Single-thread decoderYcompatible
Get MediaInfoY----
Get Codec ParamYVideo&Audio
Get Media DurationYVideo&Audio
Get Video SizeY----
Get Video FPSY----
Get Audio SampleRateY----
Chase FrameYHTTP-FLV(no audio)
PlayBackRateYH.264/H.265/AV1
ResizeY----
Get SEI DataY----

WebRTC Publish and Playback

WHIP is the standard WebRTC HTTP ingestion protocol, and WHEP is the standard WebRTC HTTP egress protocol. h265web.js is a player, so WHEP is the recommended playback input. The HTTP(S) endpoint carries SDP signaling; negotiated media still uses WebRTC ICE/DTLS/SRTP.

For ZLMediaKit RTMP-to-WebRTC conversion, set the timestamp policy before testing:

[protocol]
modify_stamp=1
paced_sender_ms=0

modify_stamp=1 uses the ZLMediaKit receive clock with smoothing. With modify_stamp=2, some H.264 + AAC RTMP inputs can continue decoding at the expected frame rate while Chrome drops late frames during native WebRTC playout.

The following command publishes the tested H.264 + AAC source to ZLMediaKit. ZLMediaKit then exposes it through WHEP:

ffmpeg -hide_banner -stream_loop -1 -re \
  -i /path/to/input.flv \
  -vf scale=640:360,format=yuv420p \
  -c:v libx264 -preset veryfast -tune zerolatency \
  -profile:v baseline -level 3.1 -bf 0 \
  -g 25 -keyint_min 25 -sc_threshold 0 \
  -c:a aac -profile:a aac_low -ar 44100 -ac 2 -b:a 128k \
  -f flv rtmp://127.0.0.1/live/test

Supported playback inputs for that stream:

http://127.0.0.1/index/api/whep?app=live&stream=test
webrtc://127.0.0.1/live/test
http://127.0.0.1/index/api/webrtc?app=live&stream=test&type=play

The first URL is standard WHEP and is recommended. webrtc:// is an SDK compatibility URL converted to WHEP. The third URL is specific to ZLMediaKit.

const player = H265webjsPlayer();

player.on_ready_show_done_callback = function () {
  console.log('WebRTC first frame ready');
};

player.on_play_time = function (seconds) {
  console.log('WebRTC play time', seconds);
};

player.on_error_callback = function (error) {
  console.error('WebRTC playback error', error);
};

player.build({
  player_id: 'canvas111',
  base_url: './static/',
  wasm_js_uri: 'h265web_wasm.js',
  wasm_wasm_uri: 'h265web_wasm.wasm',
  ext_src_js_uri: 'extjs.js',
  ext_wasm_js_uri: 'extwasm.js',
  width: 640,
  height: 360,
  auto_play: false,
  ignore_audio: false,
  core: 'webrtc'
});

player.load_media('http://127.0.0.1/index/api/whep?app=live&stream=test');

Omit core to let the SDK recognize the three WebRTC URL forms automatically. WebRTC uses the existing player lifecycle and callback names; no separate public API is required. Native WebRTC live playback stays at 1x and does not support seek. Standard WebRTC can only receive codecs negotiated by the browser. WebCodecs/WASM fallback for a non-negotiated codec requires the server to implement the optional h265web-rtc-encoded/v1 encoded-media transport.

Documentation

Partner Projects

About


Donate

WechatAlipayPayPal
-

FFmpegSupportH265LiveEncode


TranscodeAndGet265CodecFileByFFmpeg

  • mp4
ffmpeg -i input.mp4 \
-vcodec libx265 -pix_fmt \
-acodec aac -ac 2 -ar 44100 \
-preset medium -maxrate 1000k -bufsize 1000k \
-vtag hvc1 \
-movflags faststart \
-y video.mp4
  • hls/m3u8 capture
ffmpeg -f avfoundation -i 1:0 \
-q 4 -r 10 \
-filter_complex "scale=1280:720" \
-pix_fmt yuv420p \
-vcodec libx265 \
-ar 22050 -ab 64k -ac 1 -acodec aac \
-threads 4 \
-preset veryfast \
-f segment \
-segment_list test.m3u8 \
-segment_time 5 \
-y /Users/numberwolf/Documents/webroot/VideoMissile/VideoMissilePlayer/res/hls1/v-%03d.ts
  • mpeg-ts
ffmpeg -ss 20 -t 10 -i ./res/xinxiaomen.mp4 \
-vcodec libx265 -x265-params "bframes=0:keyint=10" -r 24 -filter_complex "scale=720:1280" -preset fast -maxrate 800k -bufsize 800k \
-acodec aac -ar 22050 -ac 1 \
-pix_fmt yuv420p \
-f mpegts -y ./res/veilside2.ts

UpdateLog

UpdateContent
Time2026/08/25
-0.Added native WebRTC live playback with standard WHEP signaling, webrtc:// compatibility URLs and the ZLMediaKit private WebRTC API
-1.Added automatic WebRTC URL routing and explicit core: 'webrtc' selection without changing the existing build() and load_media() API
-2.Added AV, video-only and audio-only negotiated playback, existing lifecycle/error callbacks, release/rebuild and multi-instance isolation
-3.Added WHIP publish and WHEP playback demos, plus real Chrome regression coverage for WHEP, MP4, HTTP-FLV and HTTP-TS
-4.Documented the ZLMediaKit modify_stamp=1 requirement for stable RTMP-to-WebRTC A/V timestamps
Time2026/08/10
-0.Added callback-aware HLS mainline routing across Native HLS, MSE, WebCodec and WASM; auto/mainline never enter past-core/ext*, while legacy must be selected explicitly
-1.Aligned callback contracts across HLS, MP4, FLV and MPEG-TS, including SEI, NAL/frame/render, cache, seek, lifecycle, GPU and A/V-sync callbacks
-2.Improved HLS master/media playlists, redirects, live sliding windows, discontinuities, codec detection, HEVC samples, keyframes and timestamp handling
-3.Strengthened seek completion, release/rebuild, worker cleanup, bounded release timeout and multi-instance isolation
-4.Clarified audio controls: ignore_audio skips the audio pipeline and is not mute; set_voice(0) can be restored with a positive volume
-5.Updated English/Chinese integration documentation and expanded automated and browser regression coverage
Time2026/08/03
-0.Optimized Auto core selection to prefer native/MSE, then WebCodec, then WASM/SIMD, with controlled fallback
-1.Improved H.264/H.265 playback with AAC, PCM, G.711A and G.711U audio; unsupported audio no longer downgrades a playable video core
-2.Fixed repeated backward jumps and frame skipping in HEVC B-frame HTTP-TS and WebSocket-TS live streams by normalizing only the detected abnormal live-TS DTS cadence while preserving CTS reorder information
-3.Improved player lifecycle cleanup, error fallback and multi-instance stability
Time2026/03/28
-0.Update more powerful version
Time2022/11/06
-0.Update
Time2022/11/02
-0.Update WASM
Time2022/10/22
-0.Support: Hard-Decode for FLV/HTTP-FLV/MP4
-1.Support: AVC with Mpeg-TS
Time2022/09/13
-0.Fixed: AVC stream loop buffer error without autoplay
Time2022/09/12
-0.Fixed: hevc url cannot play without text of "http"
Time2022/08/24
-0.Feature: Safari with native player(version>13)
Time2022/08/23
-0.Fixed: Buffer Progress with AVC
Time2022/08/13
-0.Support: Resize
Time2022/07/27
-0.Support: PlayBackRate
Time2022/07/12
-0.Fixed some problem
Time2022/07/06-10
-0.Support g711u (http-flv)
-1.Fixed: HTTP-FLV(AVC) without Audio
Time2022/07/01
-0.Feature: HTTP-FLV(Without audio) Stream Performance optimizing
Time2022/06/27
-0.Fixed: problem with hls parser
Time2022/06/26
-0.Support g711a (http-flv)
-1.Fixed 264(avc) flv error with mediainfo
-2.Support Multi/Single Thread
Time2022/05/18
-0.Support multi-thread decode
-1.Support mp4's cache length config
-2.Performance optimizing
-3.This version is for Beta
Time2022/05/09
-0.Suport play with Websocket 265 raw stream
Time2022/05/07
-0.Fixed:MP4(VOD) retry error
-1.Support:HEVC raw stream(VOD), create with url
-2.Support:MKV format
Time2022/04/21
-0.Performance optimizing
Time2022/04/17
-New Opensource Free Protocol CYL_Free-1.0 LICENSE-Free_CN.MD
Time2022/04/14
-0.Support Mov File
-1.Support HTTP-FLV/HTTP-TS/HLS Autoplay
-2.Performance optimizing of 1080P MP4(VOD)
-3.Retry of mp4 sniff action
-4.Support AV1
-5.Support Play frame by frame
-6.Support Video Frame Snapshot
Time2022/03/28
-0.Support MPEG-PS(MPEG1) stream
Time2022/03/02
-0.Fixed h264 FLV(LIVE) can not get resolution info with retry
Time2022/01/17
-0.Fixed ISSUE of HLS 265 OOM Case https://github.com/numberwolf/h265web.js/issues/108
-1.Fixed ISSUE of HLS Split Rules https://github.com/numberwolf/h265web.js/issues/105
-2.Add New Demo index-debug.html
-3.Fixed 10+playes of 264 play failed, stack overflow
Time2021/12/31
-0.Add H.264 HTTP-FLV Retry after error
Time2021/12/24
-0.Fixed H.264 HTTP-FLV Some Badcase with callback
Time2021/12/19
-0.Fixed H.264 HLS Callback's problem
Time2021/12/08
-0.Fixed Problem of H.264 MP4 onReadyShowDone Event
Time2021/12/04 - In the small hours
-0.Fixed http-flv 265 Render With crash
-1.Fixed hls problem of fullscreen
-2.Fixed some bugs
Time2021/11/29 - Night
-0.Fixed http-flv retry case and some bugs
Time2021/11/25 - Night
-0.Fixed httpflv/ws LIVE ignoreAudio problem
Time2021/11/23 - Night
-0.Fixed https://github.com/numberwolf/h265web.js/issues/90
Time2021/11/21 - In the small hours
-0.Support Websocket-FLV (HEVC/H.265)
-1.Support Websocket-TS (HEVC/H.265)
-2.Support HTTP-TS (HEVC/H.265)
Time2021/11/16 - Evening
-0.First request, if no response and timeout, then retry 5 times
Time2021/11/15 - Evening
-0.HTTP-FLV auto retry when timeout with out packet.(7s)
Time2021/11/14 - Evening
-0.Add wasm file of 265mb version(can memory auto grow)
-1.Add wasm file of 512mb version(can memory auto grow)
Time2021/11/04 - Evening
-0.Fixed: release many times with crash
Time2021/10/26 - Evening
-0.Fixed some bugs
Time2021/10/24 - Evening
-0.Support Codec of AVC/H.264's MP4/HLS/M3u8/FLV/HTTP-FLV play
Time2021/10/18 - Evening
-0.Add new example
Time2021/10/16 - Evening
-0.Fixed: HTTP-FLV: Mediainfo's codec fault value
-1.Update example
Time2021/10/14 - Evening
-0.Fixed: Mediainfo's codec fault value
Time2021/10/13 - Evening
-0.The player compatible with WebIDE develop, split wasm(js) and h265web.js, need include wasm(js) as single
Time2021/10/12 - Evening
-0.Fixed: Support HTTP-FLV(HEVC) without fps param
Time2021/10/09 - In the small hours
-0.Support HTTP-FLV(HEVC) LIVE, CodecID=12
-0.MP4/FLV(VOD) performance optimizing of Seek operation(out of cache area)
Time2021/09/27 - Evening
-0.M3u8/MpegTS performance optimizing of Seek operation(out of cache area)
Time2021/09/25 - In the small hours
-0.HLS Live Fixed: Crash by OOM
-1.HLS Live Fixed: MPEG-TS full path
-2.HLS Live Fixed: Stop by lost stream a moment
-3.HLS Live Fixed: Stop by unstable network
Time2021/09/08 - Evening
-0.Fixed: M3U8 Seek with Decode Failed
-1.Fixed: Some MP4 Case
-2.Config update, remove some options, make it auto set
Time2021/09/07 - Evening
-0.M3U8 Fixed: some error with parse mpegts file
Time2021/09/07 - In the small hours
-0.Bak Player Core - Fixed:MP4/FLV(VOD) Seek BUG can not seek to 0; And performance optimizing for play
Time2021/08/15
-0.H265/HEVC Upgrade Raw Data Player for VOD/LIVE
Time2021/07/18
-0.Upgrade: Player UI Style
-1.Support: fullscreen & close fullscreen
-2.Add Event: open/close fullscreen
Time2021/07/11
-0.Fixed: The player compatible with ZLMediaKit + HUAWEI HoloSens Camera LIVE Stream
Time2021/07/04
-0.Fixed: ISSUE#58 (When default player-core's status is caching-frames, can not pause video)
Time2021/07/01
-0.Add example and package.json file
Time2021/06/27
-0.Open Source!
-1.Support Seek in FLV
-2.Fixed: Seek problems with bak player core mode
-3.Add FLV type ,and do not need set player-core
Time2021/05/30
-1.Fixed: Some problem with seek and play(Important)
-2.Feature: Event/Callback of Video's cover image load finished
Time2021/05/24
-1.FLV VOD Play(In the bak player core mode)
Time2021/05/21
-1.HLS(LIVE:No audio)performance optimizing
Time2021/05/18
-1.HLS(LIVE) performance optimizing and add Audio
Time2021/05/16
-1.MP4(VOD) Fixed:BD265 Mp4 box badcase
Time2021/05/15
-1.Fixed: HLS Play(LIVE)
Time2021/04/27
-1.Fixed: Some video playing with gray block(mosic)
-2.Fixed: Some video when playing first gop with gray block(mosic)
Time2021/04/22
-1.Bak player core mode(test) support: seek
-2.Bak player core mode(test) support: yuvj420p
-3.Others
Time2021/04/12
-1.Fixed bug: Some video(encode hev) play failed
-2.Fixed bug: Some video(nalu unstandard) play failed
-3.Fixed bug: Some video play error with mosic
Time2021/04/07
-1.Fixed duration error
Time2021/03/28
-1.Add cache process event
-2.Fixed some bugs
-3.Remove HLS Log
-4.Play without audio optio(New Core)
Time2021/03/14
-1.Bak player core mode: Fixed: render of bytes align
Time2021/03/12
-1.Sorry my friends, I was too tired to make a mistake with hls feature... Now I have fixed it. _!
Time2021/03/06
-1.Bak player core mode, Fixed: multi-stream play badcase
Time2021/02/28
-1.Add function to feed 265 nalu-frame append265NaluFrame(nalBuf);
-2.Add new library to parse 265 stream raw-parser.js
Time2021/02/21
-1.New SDK Project for H.265/HEVC decoder - https://github.com/numberwolf/h265web.js-wasm-decoder
Time2021/02/18
-1.Bak player core mode support play with audio
Time2021/02/08
-1.Bak player core mode (beta version , do not support play audio and seek. Make your mp4's moov box front of the mdat)
Time2021/01/04
-1.Player Support Hevc file
-2.Player Support Hevc stream
-3.Remove Play/Pause Mask
-4.Add Event:onPlayFinish, called when play video finished

Contributors

numberwolf

229 commits

girlbymirror

65 commits

nonzzz

12 commits

Languages

JavaScript

88.1%

HTML

7.4%

CSS

4.5%