Skip to content

Commit

Permalink
add performance report
Browse files Browse the repository at this point in the history
  • Loading branch information
Puiching-Memory committed Jul 7, 2024
1 parent db0e8b3 commit a7f6066
Show file tree
Hide file tree
Showing 9 changed files with 1,262 additions and 771 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ dist/
trashcan/
*.whl
.coverage
.pytest_cache
.pytest_cache
cache/
43 changes: 27 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,33 @@ with open(vedio_path,'rb') as data:
# 性能

* 目前,cython层的部分矩阵处理导致了延迟,4k视频下无法保持24帧正常播放。
* 总体测量下,当前版本性能损失在50%左右
* 性能最佳实践报告(待建)

| 分辨率 | FPS(libde265) | FPS(pylibde265) |
| ------ | ------------- | --------------- |
| 720p | 284 | |
| 1080p | 150 | |
| 4k | 36 | |
| 分辨率 | 视频 | FPS(libde265) | FPS(pylibde265) | FPS(后处理) |
| ------ | ------------------------------------------------------------------------------------ | ------------- | --------------- | ----------- |
| 720p | [bbb-1280x720-cfg06](https://www.libde265.org/hevc-bitstreams/bbb-1280x720-cfg06.mkv) | 195 | 83 | 56 |
| 1080p | [bbb-1920x1080-cfg06](https://www.libde265.org/hevc-bitstreams/bbb-1920x1080-cfg06.mkv) | 101 | 47 | 29 |
| 4k | [tos-4096x1720-tiles](https://www.libde265.org/hevc-bitstreams/tos-4096x1720-tiles.mkv) | 35 | 19 | 11 |

线程性能分析:
<img src="./multimedia/image/performance-0.0.1a.webp" alt="image:vedio_steam">

| 线程 | 视频1-FPS | 视频2-FPS |
| ---- | --------- | --------- |
| 1 | | |
| 2 | | |
线程性能分析:

测试环境:

test/test_performance.py
test/vis_performance.py

| 设置 | 状态 |
| ---------- | ---- |
| deblocking | off |
| SAO | off |

test/test_performance_c.c
| 分辨率 | 文件名 | 范围 |
| ------ | ------------------- | -------- |
| 4k | tos-4096x1720-tiles | 前3000帧 |
| 1080p | bbb-1920x1080-cfg06 | 前3000帧 |
| 720p | bbb-1280x720-cfg06 | 前3000帧 |

| CPU | GPU | 系统 | 电源性能设置 | libde265 | pylibde265 |
| --------------- | --------- | --------------------- | ------------ | -------- | ---------- |
Expand All @@ -110,7 +117,7 @@ test/test_performance_c.c
3. 安装编译器(Visual Studio 生成工具 2022 or Visual Studio 2022 C++开发套件)
4. 运行 `python tools_build.py`

环境需求-作为本地构建
环境需求-作为本地构建:

```
setuptools >= 69.0.0
Expand All @@ -119,7 +126,7 @@ cython >= 3.0.10
build >= 1.2.1
```

环境需求-作为发布库
环境需求-作为发布库:

```
cython >= 3.0.10
Expand All @@ -130,11 +137,12 @@ scipy >= 1.14.0
numpy >= 2.0.0
```

环境需求-测试
环境需求-测试:

```
coverage >= 7.5.4
pytest >= 8.2.2
matplotlib >= 3.9.1
```

# 常见问题
Expand All @@ -154,6 +162,8 @@ pytest >= 8.2.2

* [ ] 帧解码性能改进
* [ ] intel_GPU支持
* [ ] 流式加载数据(而不是在开始解码前完全载入)
* [ ] 可修改的设置项

# 后记

Expand All @@ -163,7 +173,8 @@ pytest >= 8.2.2

鸣谢:

* libde265 C/C++仓库 : 作者[@strukturag](https://github.com/strukturag/libde265)
* [libde265](https://github.com/strukturag/libde265)--C/C++仓库:作者[@strukturag](https://github.com/strukturag)
* [pyde265](https://github.com/kloppjp/pyde265)--提供linux系统的py绑定:作者[@kloppjp](https://github.com/kloppjp)

统计数据标签:

Expand Down
Binary file added multimedia/image/performance-0.0.1a.webp
Binary file not shown.
47 changes: 47 additions & 0 deletions multimedia/mindmap/vedio_steam.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<mxfile host="Electron" modified="2024-06-16T09:58:09.745Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.5.3 Chrome/124.0.6367.207 Electron/30.0.6 Safari/537.36" etag="ZarOZzXxzNi7sSdqo7w9" version="24.5.3" type="device">
<diagram name="第 1 页" id="4FnR3ZsErp5dX7pyPaFg">
<mxGraphModel dx="698" dy="470" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="icQ4BDttL7p6WTc5oLJl-11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="icQ4BDttL7p6WTc5oLJl-6" target="icQ4BDttL7p6WTc5oLJl-7" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="icQ4BDttL7p6WTc5oLJl-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="icQ4BDttL7p6WTc5oLJl-6" target="icQ4BDttL7p6WTc5oLJl-8" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="icQ4BDttL7p6WTc5oLJl-6" value="vedio.mp4" style="html=1;whiteSpace=wrap;container=1;recursiveResize=0;collapsible=0;fontSize=17;labelPosition=center;verticalLabelPosition=middle;align=center;verticalAlign=middle;labelBackgroundColor=none;horizontal=1;rounded=1;glass=0;shadow=0;fillStyle=solid;fillColor=#744da3;opacity=50;" parent="1" vertex="1">
<mxGeometry x="80" y="280" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="icQ4BDttL7p6WTc5oLJl-16" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="icQ4BDttL7p6WTc5oLJl-7" target="icQ4BDttL7p6WTc5oLJl-13" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="icQ4BDttL7p6WTc5oLJl-18" value="libde265" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;labelBorderColor=none;" parent="icQ4BDttL7p6WTc5oLJl-16" vertex="1" connectable="0">
<mxGeometry relative="1" as="geometry">
<mxPoint y="-10" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="icQ4BDttL7p6WTc5oLJl-7" value="HEVC" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#2fa0c6;opacity=50;" parent="1" vertex="1">
<mxGeometry x="240" y="240" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="icQ4BDttL7p6WTc5oLJl-20" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="icQ4BDttL7p6WTc5oLJl-8" target="icQ4BDttL7p6WTc5oLJl-19" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="icQ4BDttL7p6WTc5oLJl-21" value="other decoder" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;" parent="icQ4BDttL7p6WTc5oLJl-20" vertex="1" connectable="0">
<mxGeometry relative="1" as="geometry">
<mxPoint y="-10" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="icQ4BDttL7p6WTc5oLJl-8" value="ACC" style="rounded=1;whiteSpace=wrap;html=1;opacity=50;" parent="1" vertex="1">
<mxGeometry x="240" y="320" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="icQ4BDttL7p6WTc5oLJl-13" value="Raw&amp;nbsp;&lt;span style=&quot;background-color: initial;&quot;&gt;Image sequence&lt;/span&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#2FA0C6;opacity=50;" parent="1" vertex="1">
<mxGeometry x="480" y="240" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="icQ4BDttL7p6WTc5oLJl-19" value="Raw Audio Steam" style="rounded=1;whiteSpace=wrap;html=1;opacity=50;" parent="1" vertex="1">
<mxGeometry x="480" y="320" width="160" height="40" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
9 changes: 7 additions & 2 deletions running_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,25 @@


#vedio_path = './Kinkaku-ji.h265'
vedio_path = r"D:\GitHub\pylibde265\multimedia\video\Kinkaku-ji.h265"
vedio_path = r"C:\Users\1138\Downloads\tos-4096x1720-tiles\tos-4096x1720-tiles.hevc"

dec = pylibde265.pyde265.decode_decoder(10)

with open(vedio_path,'rb') as data:
re = dec.load(data)
frame = 0
for re in dec.decode():
start_t = time.time()
frame += 1
#print(re['pts'])
#print(re['ttd'],re['ttd_max'])
#print(re)
image_data = re['image']
image_data = cp.asnumpy(image_data)
image = PIL.Image.fromarray(image_data,mode='YCbCr')

with open('./cache/py.txt','a') as file:
print(time.time()-start_t,file=file)
#image.save(f'./cache/{str(frame).zfill(9)}.jpg')
image.show()
#image.show()

Loading

0 comments on commit a7f6066

Please sign in to comment.