Skip to content

Commit

Permalink
Merge pull request #143 from girlbymirror/master
Browse files Browse the repository at this point in the history
hevc/mkv
  • Loading branch information
girlbymirror authored May 7, 2022
2 parents 85c646a + 7e58735 commit efb3891
Show file tree
Hide file tree
Showing 97 changed files with 1,301 additions and 769 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ example/dist/missile-512mb*
example/dist/missile-256mb*
example_normal/dist/missile-512mb*
example_normal/dist/missile-256mb*
src/src/decoder/dc-worker*
13 changes: 9 additions & 4 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
| <img src="resource/icon-ts.png" width="100"> | <img src="resource/icon-mpegps.png" width="100"> | <img src="resource/icon-av1.png" width="100"> | <img src="resource/icon-mov-h265.png" width="100">|
| MPEG-TS(VOD) | MPEG-PS(VOD) | AV1(Chrome) | MOV(H.265) |
| <br> | <br> | <br> | <br> |
| <img src="resource/icon-todo.png" width="100"> | <img src="resource/icon-todo.png" width="100"><br> |
| G711A | HDR10(BT2020) |
| <img src="resource/icon-hevc.png" width="100"> | <img src="resource/icon-mkv.png" width="100"><br> | <img src="resource/icon-todo.png" width="100"> | <img src="resource/icon-todo.png" width="100"><br> |
| HTTP-HEVC | MKV(HEVC) | G711A | HDR10(BT2020) |

</font>
</strong>
Expand Down Expand Up @@ -178,6 +178,7 @@
| ---- | ---- | ---- | ---- |
| mp4 | 点播 || ---- |
| mov | 点播 || HEVC/H.265 |
| mkv | 点播 || HEVC/H.265 |
| av1 | 点播 || Chrome |
| mpeg-ts | 点播 || ---- |
| mpeg-ps | 点播 || ---- |
Expand Down Expand Up @@ -405,7 +406,6 @@ var config = {

```javascript
let config = {
type: "raw265",
player: "glplayer",
width: 960,
height: 540,
Expand Down Expand Up @@ -456,7 +456,8 @@ var config = {
let player = H265webjsModule.createPlayer(videoURL, config);
```

* 3. 如果创建的是`raw265`类型的裸流数据播放 请注意
* 3. 如果创建的是`raw265`类型的Websocket等直播裸流数据播放 请注意
(普通265点播流直接填写url播放就可以,不需要走如下流程)
> 这部分fetch请求网络数据以及异步喂数据的过程 请自行改写,下面给出的仅仅是一个demo,网络IO和解析265流为帧数据会非常耗时。
>
> 如果你可以通过websocket直接一帧一帧传输的话,那么只需要调用喂265数据的函数即可。
Expand Down Expand Up @@ -981,6 +982,10 @@ ffmpeg -ss 20 -t 10 -i ./res/xinxiaomen.mp4 \

| 更新日志 | 内容 |
| ---- | ---- |
| 时间 | 2022/05/07 |
| - | 0.点播内核错误优化 |
| - | 1.265裸流点播流程优化,只需要填写url和rawFps即可播放 |
| - | 2.支持MKV格式 |
| 时间 | 2022/04/21 |
| - | 0.播放器内核性能优化 |
| 时间 | 2022/04/17 |
Expand Down
11 changes: 8 additions & 3 deletions README_EN.MD
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ A hevc/h.265 web player, easy to play 1080P. `~^_^~ For love` if <a href="https:
| <img src="resource/icon-ts.png" width="100"> | <img src="resource/icon-mpegps.png" width="100"> | <img src="resource/icon-av1.png" width="100"> | <img src="resource/icon-mov-h265.png" width="100">|
| MPEG-TS(VOD) | MPEG-PS(VOD) | AV1(Chrome) | MOV(H.265) |
| <br> | <br> | <br> | <br> |
| <img src="resource/icon-todo.png" width="100"> | <img src="resource/icon-todo.png" width="100"><br> |
| G711A | HDR10(BT2020) |
| <img src="resource/icon-hevc.png" width="100"> | <img src="resource/icon-mkv.png" width="100"><br> | <img src="resource/icon-todo.png" width="100"> | <img src="resource/icon-todo.png" width="100"><br> |
| HTTP-HEVC | MKV(HEVC) | G711A | HDR10(BT2020) |

</font>
</strong>
Expand Down Expand Up @@ -177,6 +177,7 @@ Notice:
| ---- | ---- | ---- | ---- |
| mp4 | Video on demand | Y | ---- |
| mov | Video on demand | Y | HEVC/H.265 |
| mkv | Video on demand | Y | HEVC/H.265 |
| av1 | Video on demand | Y | Chrome |
| mpeg-ts | Video on demand | Y | ---- |
| mpeg-ps | Video on demand | Y | ---- |
Expand Down Expand Up @@ -400,7 +401,6 @@ let config = {
```javascript
let videoURL = "demo/res/raw.h265";
let config = {
type: "raw265",
player: "glplayer",
width: 960,
height: 540,
Expand Down Expand Up @@ -456,6 +456,7 @@ let config = {
```

* 3. NOTICE! If you want to create `raw265` stream player
(Do not need execute with this step when you play 265 vod stream)

* `raw265` type,feed byte data

Expand Down Expand Up @@ -966,6 +967,10 @@ ffmpeg -ss 20 -t 10 -i ./res/xinxiaomen.mp4 \

| Update | Content |
| ---- | ---- |
| Time | 2022/05/07 |
| - | 0.Fixed:MP4(VOD) retry error |
| - | 1.Support:HEVC raw stream(VOD), create with url |
| - | 2.Support:MKV format |
| Time | 2022/04/21 |
| - | 0.Performance optimizing |
| Time | 2022/04/17 |
Expand Down
18 changes: 9 additions & 9 deletions dist/h265webjs-v20220422.js → dist/h265webjs-v20220507.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Github: https://github.com/numberwolf/h265web.js
*
**********************************************************/
require('./h265webjs-v20220422');
require('./h265webjs-v20220507');
export default class h265webjs {
static createPlayer(videoURL, config) {
return window.new265webjs(videoURL, config);
Expand Down
2 changes: 0 additions & 2 deletions dist/missile-120func-v20220421.js

This file was deleted.

2 changes: 2 additions & 0 deletions dist/missile-120func-v20220507.js

Large diffs are not rendered by default.

Binary file not shown.
2 changes: 2 additions & 0 deletions dist/missile-120func.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/missile-256mb-v20220421.js

This file was deleted.

2 changes: 2 additions & 0 deletions dist/missile-256mb-v20220507.js

Large diffs are not rendered by default.

Binary file not shown.
2 changes: 2 additions & 0 deletions dist/missile-256mb.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/missile-512mb-v20220421.js

This file was deleted.

2 changes: 2 additions & 0 deletions dist/missile-512mb-v20220507.js

Large diffs are not rendered by default.

Binary file not shown.
2 changes: 2 additions & 0 deletions dist/missile-512mb.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/missile-v20220421.js

This file was deleted.

Binary file removed dist/missile-v20220421.wasm
Binary file not shown.
2 changes: 2 additions & 0 deletions dist/missile-v20220507.js

Large diffs are not rendered by default.

Binary file added dist/missile-v20220507.wasm
Binary file not shown.
2 changes: 2 additions & 0 deletions dist/missile.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions example/dist/dist-play.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Github: https://github.com/numberwolf/h265web.js
*
**********************************************************/
require('./h265webjs-v20220422');
require('./h265webjs-v20220507');
export default class h265webjs {
static createPlayer(videoURL, config) {
return window.new265webjs(videoURL, config);
Expand Down
2 changes: 0 additions & 2 deletions example/dist/missile-120func-v20220421.js

This file was deleted.

2 changes: 2 additions & 0 deletions example/dist/missile-120func-v20220507.js

Large diffs are not rendered by default.

Binary file not shown.
2 changes: 2 additions & 0 deletions example/dist/missile-120func.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions example/dist/missile-v20220421.js

This file was deleted.

Binary file removed example/dist/missile-v20220421.wasm
Binary file not shown.
2 changes: 2 additions & 0 deletions example/dist/missile-v20220507.js

Large diffs are not rendered by default.

Binary file added example/dist/missile-v20220507.wasm
Binary file not shown.
2 changes: 2 additions & 0 deletions example/dist/missile.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<link rel="stylesheet" type="text/css" href='player-view/css/index.css'>
<link rel="stylesheet" type="text/css" href='player-view/css/button.css'>
<link rel="stylesheet" type="text/css" href='player-view/css/progress.css'>
<script src="dist/missile-v20220421.js"></script> <!-- IMPORTANT -->
<script src="dist/missile.js"></script> <!-- IMPORTANT -->
<script src='dist/dist-play.js'></script>
<style>
</style>
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example_normal/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Github: https://github.com/numberwolf/h265web.js
*
**********************************************************/
require('./h265webjs-v20220422');
require('./h265webjs-v20220507');
export default class h265webjs {
static createPlayer(videoURL, config) {
return window.new265webjs(videoURL, config);
Expand Down
2 changes: 0 additions & 2 deletions example_normal/dist/missile-120func-v20220421.js

This file was deleted.

2 changes: 2 additions & 0 deletions example_normal/dist/missile-120func-v20220507.js

Large diffs are not rendered by default.

Binary file not shown.
2 changes: 1 addition & 1 deletion example_normal/dist/missile-120func.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions example_normal/dist/missile-v20220421.js

This file was deleted.

Binary file removed example_normal/dist/missile-v20220421.wasm
Binary file not shown.
2 changes: 2 additions & 0 deletions example_normal/dist/missile-v20220507.js

Large diffs are not rendered by default.

Binary file added example_normal/dist/missile-v20220507.wasm
Binary file not shown.
2 changes: 2 additions & 0 deletions example_normal/dist/missile.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions example_normal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
<link rel="stylesheet" type="text/css" href='player-view/css/index.css'>
<link rel="stylesheet" type="text/css" href='player-view/css/button.css'>
<link rel="stylesheet" type="text/css" href='player-view/css/progress.css'>
<script src="dist/missile-v20220421.js"></script> <!-- IMPORTANT -->
<script src="dist/missile.js"></script> <!-- IMPORTANT -->
<!--<script src="dist/missile-256mb-v20211104.js"></script>--> <!-- wasm for 265mb memory(with grow) -->
<script src="dist/h265webjs-v20220422.js"></script> <!-- IMPORTANT -->
<script src="dist/h265webjs-v20220507.js"></script> <!-- IMPORTANT -->
<script src="example.js"></script> <!-- IMPORTANT -->
<style>
</style>
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example_vue/public/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Github: https://github.com/numberwolf/h265web.js
*
**********************************************************/
require('./h265webjs-v20220422');
require('./h265webjs-v20220507');
export default class h265webjs {
static createPlayer(videoURL, config) {
return window.new265webjs(videoURL, config);
Expand Down
2 changes: 2 additions & 0 deletions example_vue/public/dist/missile-120func-v20220507.js

Large diffs are not rendered by default.

Binary file not shown.
2 changes: 2 additions & 0 deletions example_vue/public/dist/missile-120func.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions example_vue/public/dist/missile-256mb-v20220507.js

Large diffs are not rendered by default.

Binary file not shown.
2 changes: 2 additions & 0 deletions example_vue/public/dist/missile-256mb.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions example_vue/public/dist/missile-512mb-v20220507.js

Large diffs are not rendered by default.

Binary file not shown.
2 changes: 2 additions & 0 deletions example_vue/public/dist/missile-512mb.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions example_vue/public/dist/missile-v20220421.js

This file was deleted.

Binary file removed example_vue/public/dist/missile-v20220421.wasm
Binary file not shown.
2 changes: 2 additions & 0 deletions example_vue/public/dist/missile-v20220507.js

Large diffs are not rendered by default.

Binary file added example_vue/public/dist/missile-v20220507.wasm
Binary file not shown.
2 changes: 2 additions & 0 deletions example_vue/public/dist/missile.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example_vue/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
>
</noscript>

<script src="/dist/missile-v20220421.js"></script>
<script src="/dist/missile.js"></script>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
Expand Down
4 changes: 2 additions & 2 deletions index-debug.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
<meta charset="utf-8" name="email" content="[email protected]">
<meta charset="utf-8" name="discord" content="numberwolf#8694">
<meta charset="utf-8" name="github" content="https://github.com/numberwolf/h265web.js">
<script src="dist/missile-v20220421.js"></script> <!-- IMPORTANT -->
<script src="dist/missile.js"></script> <!-- IMPORTANT -->
<!--<script src="dist/missile-120func-v20220117.js"></script>--> <!-- IMPORTANT -->
<script src="dist/h265webjs-v20220422.js"></script> <!-- IMPORTANT -->
<script src="dist/h265webjs-v20220507.js"></script> <!-- IMPORTANT -->
<style>
</style>
</head>
Expand Down
Binary file added resource/icon-hevc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resource/icon-mkv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 51 additions & 22 deletions src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,43 @@ source ./version.sh
"start": "cp src/decoder/missile* ./dist/ && cp src/demuxer/missile* ./dist/ && cp -r src/assets dist && browserify src/h265webjs.js -o ./dist/h265webjs_tmp.js && terser ./dist/h265webjs_tmp.js -c pure_funcs=[],toplevel=true -m -o ./dist/h265webjs.js && rm ./dist/h265webjs_tmp.js && cp -r ./dist/* ./demo/dist/ && browserify play.js -o ./dist/play.js && node server.js",
!

# # REMOVE_FUNCS='"console.log","console.warn","alert"'
# # REMOVE_FUNCS='"alert"'
# REMOVE_FUNCS='"console.warn","alert"'
# # REMOVE_FUNCS='"console.log","alert"'
# # REMOVE_FUNCS=''

# rm ./dist/*.js
# rm ./dist/*.wasm

# cmd[0]="cp src/decoder/missile* ./dist/"
# # cmd[1]="cp src/demuxer/missile* ./dist/"
# cmd[1]="cp -r src/assets dist"
# cmd[2]="browserify src/h265webjs.js -o ./dist/h265webjs_tmp.js"
# cmd[3]="terser ./dist/h265webjs_tmp.js -c pure_funcs=[${REMOVE_FUNCS}],toplevel=true -m -o ./dist/h265webjs-${VERSION}.js"
# cmd[4]="cp -r src/index.js dist/"
# cmd[5]="rm ./dist/h265webjs_tmp.js"
# cmd[6]="cp -r ./dist/* ./demo/dist/"
# cmd[7]="cp ./src/decoder/raw-parser.js ./dist/" # extension module

# cmd[8]="browserify worker-fetch.js -o ./dist/worker-fetch-dist.js"
# cmd[9]="browserify worker-parse.js -o ./dist/worker-parse-dist.js"

# cmd[10]="cat src/decoder/missile.js src/decoder/dc-worker.js > ./dist/dc-worker-dist.tmp.js"
# cmd[11]="terser ./dist/dc-worker-dist.tmp.js -c pure_funcs=[${REMOVE_FUNCS}],toplevel=true -m -o ./dist/dc-worker-dist.js"

# cmd[12]="browserify play.js -o ./dist/dist-play.js"
# # cmd[9]="cp raw-worker.js ./dist/raw-worker.js"
# # cmd[10]="cp parse-worker.js ./dist/parse-worker.js"


# cmdLen=${#cmd[@]}

# for ((i=0; i<$cmdLen; i++)); do
# echo ${cmd[$i]}
# ${cmd[$i]}
# done

REMOVE_FUNCS='"console.log","console.warn","alert"'
# REMOVE_FUNCS='"alert"'
# REMOVE_FUNCS='"console.warn","alert"'
Expand All @@ -35,31 +72,23 @@ REMOVE_FUNCS='"console.log","console.warn","alert"'
rm ./dist/*.js
rm ./dist/*.wasm

cmd[0]="cp src/decoder/missile* ./dist/"
# cmd[1]="cp src/demuxer/missile* ./dist/"
cmd[1]="cp -r src/assets dist"
cmd[2]="browserify src/h265webjs.js -o ./dist/h265webjs_tmp.js"
cmd[3]="terser ./dist/h265webjs_tmp.js -c pure_funcs=[${REMOVE_FUNCS}],toplevel=true -m -o ./dist/h265webjs-${VERSION}.js"
cmd[4]="cp -r src/index.js dist/"
cmd[5]="rm ./dist/h265webjs_tmp.js"
cmd[6]="cp -r ./dist/* ./demo/dist/"
cmd[7]="cp ./src/decoder/raw-parser.js ./dist/" # extension module

cmd[8]="browserify worker-fetch.js -o ./dist/worker-fetch-dist.js"
cmd[9]="browserify worker-parse.js -o ./dist/worker-parse-dist.js"

cmd[10]="browserify play.js -o ./dist/dist-play.js"
# cmd[9]="cp raw-worker.js ./dist/raw-worker.js"
# cmd[10]="cp parse-worker.js ./dist/parse-worker.js"

cp src/decoder/missile* ./dist/
# cmd[1]="cp src/demuxer/missile* ./dist/
cp -r src/assets dist
browserify src/h265webjs.js -o ./dist/h265webjs_tmp.js
terser ./dist/h265webjs_tmp.js -c pure_funcs=[${REMOVE_FUNCS}],toplevel=true -m -o ./dist/h265webjs-${VERSION}.js
cp -r src/index.js dist/
rm ./dist/h265webjs_tmp.js
cp -r ./dist/* ./demo/dist/
cp ./src/decoder/raw-parser.js ./dist/ # extension module

cmdLen=${#cmd[@]}
browserify worker-fetch.js -o ./dist/worker-fetch-dist.js
browserify worker-parse.js -o ./dist/worker-parse-dist.js

for ((i=0; i<$cmdLen; i++)); do
echo ${cmd[$i]}
${cmd[$i]}
done
cat src/decoder/missile.js src/decoder/dc-worker.js > ./dist/dc-worker-dist.tmp.js
terser ./dist/dc-worker-dist.tmp.js -c pure_funcs=[${REMOVE_FUNCS}],toplevel=true -m -o ./dist/dc-worker-dist.js

browserify play.js -o ./dist/dist-play.js



Expand Down
Loading

0 comments on commit efb3891

Please sign in to comment.