bmegli / realsense-network-hardware-video-encoder

Realsense hardware encoded color/ir H.264 and color/ir/depth HEVC streaming
Mozilla Public License 2.0
23 stars 3 forks source link

depth encoding time benchmark #7

Closed bmegli closed 4 years ago

bmegli commented 4 years ago

Benchmark time needed for encoding to HEVC Main10 including upload to hardware encoding, download from hardware.

Related to hardware-video-streaming#4

bmegli commented 4 years ago

Overview

The current program structure is simple sequential (grab data, upload to hardware, hardware encode, download from hardware, send). Some of those operations could be made to run concurrently if needed.

Methodology

Benchmark 56bb454 with NHVE@432cfcb:

Just to get idea of order of execution time

bmegli commented 4 years ago

Setting

 ./realsense-nhve-hevc 192.168.0.100 9768 depth 848 480 30 500 /dev/dri/renderD128 80000000 0.000025

Results

bmegli commented 4 years ago

Setting

 ./realsense-nhve-hevc 192.168.0.100 9768 depth+ir 848 480 30 500 /dev/dri/renderD128 80000000 0.000025

Results

No noticeable difference between depth and depth+ir in hardware encoding time (as above).

bmegli commented 4 years ago

Setting

 ./realsense-nhve-hevc 192.168.0.100 9768 color 640 360 30 500 /dev/dri/renderD128 80000000

Results

bmegli commented 4 years ago

Setting

 ./realsense-nhve-hevc 192.168.0.100 9768 color 1920x1080 30 500 /dev/dri/renderD128 80000000

Results

bmegli commented 4 years ago

Setting

 ./realsense-nhve-hevc 127.0.0.1 9768 infrared 848 480 30 500 /dev/dri/renderD128 80000000

Results

bmegli commented 4 years ago

As above but with 1 Mb bitrate no noticable differences

bmegli commented 4 years ago

Now H.264

bmegli commented 4 years ago

Setting

./realsense-nhve-h264 127.0.0.1 9766 color 640 360 30 5 /dev/dri/renderD128 2000000

Results

bmegli commented 4 years ago

Setting

./realsense-nhve-h264 127.0.0.1 9766 color 1920 1080 30 5 /dev/dri/renderD128 2000000

Results

bmegli commented 4 years ago

Setting

./realsense-nhve-h264 127.0.0.1 9766 infrared 848 480 30 50 /dev/dri/renderD128 1000000

Results

bmegli commented 4 years ago

Setting

./realsense-nhve-h264 127.0.0.1 9766 infrared 640 360 30 50 /dev/dri/renderD128 1000000

Results

bmegli commented 4 years ago

Now LattePanda Alpha m3-7y30

bmegli commented 4 years ago

Setting

./realsense-nhve-hevc 127.0.0.1 9768 depth 848 480 30 500 /dev/dri/renderD128 8000000 0.0000125

Results

bmegli commented 4 years ago

Setting

./realsense-nhve-hevc 127.0.0.1 9768 depth 640 360 30 500 /dev/dri/renderD128 8000000 0.0000125

Results

bmegli commented 4 years ago

Depth+ir no noticeable difference from depth only

bmegli commented 4 years ago

Setting

./realsense-nhve-hevc 127.0.0.1 9766 infrared 848 480 30 50 /dev/dri/renderD128 1000000

Results

bmegli commented 4 years ago

Setting

./realsense-nhve-hevc 127.0.0.1 9766 infrared 640 360 30 50 /dev/dri/renderD128 1000000

Results

bmegli commented 4 years ago

Now H264

bmegli commented 4 years ago

Setting

/realsense-nhve-h264 127.0.0.1 9766 infrared 848 480 30 5 /dev/dri/renderD128 1000000

Results

bmegli commented 4 years ago

Setting

/realsense-nhve-h264 127.0.0.1 9766 infrared 640 360 30 5 /dev/dri/renderD128 1000000

Results

bmegli commented 4 years ago

Summary

scenario i7-7820hk LPA m3-7y30
848x480 depth HEVC Main10 7-9 ms 8-10 ms
640x360 depth HEVC Main10 5-6 ms 6-7 ms
848x480 ir HEVC Main 5-8 ms 6-8 ms
848x480 ir H264 3-5 ms 3-5 ms
640x360 ir H264 3-4 ms 3-4 ms
bmegli commented 4 years ago

Discussion

Encoding at resolution up to 848x480 takes less than 10 ms in all tested scenarios.

This means that:

Side note - Full HD HEVC would need optimizations for 60 fps (15-17 ms encoding time).

bmegli commented 4 years ago

The above benchmark was with default ffmpeg/VAAPI compression level.

It is possible to specify quality/time trade-off with compression_level.

Notes:

With i7-7820HK Laptop (KabyLake) and:

./realsense-nhve-hevc 192.168.0.100 9768 depth 848 480 30 500 /dev/dri/renderD128 80000000 0.000025

This suggests that compression_level should be exposed as option, see HVE#6