-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
encoding depth stream #9
Comments
In our case we need:
Here we mean video codec used for depth map encoding. It will not work perfectly, there are some articles describing that. Solution sketchOn Kaby Lake It should be possible to take advantage of:
~$ vainfo --display drm --device /dev/dri/renderD129
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Kaby Lake - 2.1.0
vainfo: Supported profile and entrypoints
...
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointEncSlice
...
[AVHWDeviceContext @ 0x55c82d8b37e0] Matched "Intel i965 driver for Intel(R) Kaby Lake - 2.1.0" as known driver "Intel i965 (Quick Sync)".
25 : nv12
...
335 : p010le
With P010LE pixel format we have 1024 distinct values. This may be used for example for:
The Realsense
ConclusionWhat we need is:
|
- working proof of concept for HEVC 10 bit encoding and P010LE pixel format - tested on Kaby Lake tests #18 step in bmegli/realsense-ir-to-vaapi-h264#9
Extending HVE for HEVC supportHVE was extended with various codecs support (including HEVC) in ac3a4c1. P010LE example was added. |
Configuring Realsense Depth UnitsWe want the 10 MSB of P010LE Y plane, uint16 data to encode the depth.
When trying to input it in realsense-viewer I am confronted with the message that 0.0001 (100 um, 0.1 mm) is the minimal value. 0.0001 m
We could achieve any range/precision in software but this is good enough and we are trying to avoid software processing of depth/video data. Is this really a hardware limit or just somebody on the Realsense team constrained it because nobody imagined such scenario (setting Concluding:
This can be done by loading json with rs2 settings through rs400::advanced_mode |
- working proof of concept for encoding depth stream - into HEVC Main10, with p010le pixel format Looks great at first sight but this needs more tests. relevant to #9
In the proof of concept we loaded all settings from json file. I would rather set only the relevant Something along the line: rs2::pipeline_profile profile = pipe.start(cfg);
rs2::depth_sensor depth_sensor = profile.get_device().first<rs2::depth_sensor>();
if(!depth_sensor.supports(RS2_OPTION_DEPTH_UNITS))
{
cerr << "ERROR - device doesn't support RS2_OPTION_DEPTH_UNITS";
exit(EXIT_FAILURE);
}
depth_sensor.set_option(RS2_OPTION_DEPTH_UNITS, 0.0001f); |
This became self contained example and deserves own repository |
For design decisions/history see: bmegli/realsense-ir-to-vaapi-h264#9
The code was moved to realsense-depth-to-vaapi-hevc10 |
There is HEVC 3D extension that supports encoding depth maps.
According to this article HEVC/3DVC generally outperforms the tree-based compression methods.
One could possibly use reference 3D HEVC for software encoding and decoding.
As far as I know, those extensions are not supported by VAAPI, at least not on the Kaby Lake.
The text was updated successfully, but these errors were encountered: