H264+ / H265+ support

QVR Pro, QVR Pro Client, QVR Center and Surveillance Station
Locked
lucks
New here
Posts: 5
Joined: Fri Jun 21, 2019 5:59 pm

H264+ / H265+ support

Post by lucks »

Hi everyone!

I've seen few semi-related topics, but couldn't find one that refers to it directly so here it is.

The Question and problem statement
Are there plans to support "plus" family of codecs from Dahua and Hikvision (and potentially other vendors)? It's not only that they save massive amount of space but also bitrate is used more wisely and picture quality improvement is tremendous, at least in my case. I have Hikvision 4k dome camera mounted on my home. When working in traditional h265 mode and 16MBit bitrate the image is obviously nice, but for example I'm unable to read plates of cars arriving in front of my home. Once I switched to h265+ I'm not only seeing only bitrate of 4Mbit almost constantly but also plates are readable. And that's a real game changer.

Why doesn't it work now?
To be precise it works partially.

On Android client image is pretty much stalled all the time. Doesn't matter if used hardware or software decoding.

On Linux desktop with QVRClient it works fine when used software decoding - it's extremely CPU heavy though. When switched to hardware decoding there are glitches appearing. The problem seems to origin from libqplayer which is not able to identify surfaces for keyframes properly (not an expert, but afaik h265+ is about making static surfaces... Trully static). I tried to use system libva and libav* libraries but it didn't help - seems to me that whatever is passed to them is already broken. Note that ffmpeg and popular Linux players do support h264+ and h265+ without any issues.

Here are logs from debug execution:

Code: Select all

[DEBUG] ff.ll - [v dec @ 0x7ffac67fae38] (1) uninit
[DEBUG] ff.ll - [v dec @ 0x7ffac67facb8] (1) init: hevc 1
[DEBUG] ff.ll - [v dec @ 0x7ffac67faad8] (1) found hevc (HEVC (High Efficiency Video Coding)) decoder for codec hevc
[DEBUG] ff.ll - [v dec @ 0x7ffac67fab00] (1) with options: none
[DEBUG] ff.ll - [v dec @ 0x7ffac67faad8] (1) patch profile -99 (unknown_profile) to main for hevc
[DEBUG] ff.ll - [v dec @ 0x7ffac67faae8] (1) decoder pix_fmt: unknown
[DEBUG] ff.ll - [v dec @ 0x7ffac67facb8] (1) init hevc 1: ok
[DEBUG] ff.ll - [hw dec @ 0x7ffac57f96e8] (3) uninit
[DEBUG] ff.ll - [hw dec @ 0x7ffac57f95a8] (3) init: VAAPI (), hevc 3840 x 2160 1
[DEBUG] ff.ll - [hw dec @ 0x7ffac57f93d8] (3) found hevc (HEVC (High Efficiency Video Coding)) decoder for codec hevc
[DEBUG] ff.ll - [hw dec @ 0x7ffac57f9400] (3) with options: none
[DEBUG] ff.ll - [hw dec @ 0x7ffac57f93d8] (3) patch profile -99 (unknown_profile) to main for hevc
[DEBUG] ff.ll - [hw dec @ 0x7ffac57f93e8] (3) decoder sw_pix_fmt: unknown
[DEBUG] ff.ll - [hw dec @ 0x7ffac57f93d8] (3) init VAAPI (), hevc 3840 x 2160 1: ok
[DEBUG] ff.ll - [hevc @ 0x7ffab4001680] try hevc codec's hwaccel pix fmt: vaapi_vld
[DEBUG] ff.ll - [va (32) @ 0x7ffaf000a8d0] (3) init for hevc profile 1 (Main) 3840 x 2160
[DEBUG] ff.ll - [va (32) @ 0x7ffaf000a8d0] (3) use display: 
[DEBUG] ff.ll - [va (32) @ 0x7ffaf000a8d0] (3) init_vaapi VADisplay=0x7ffab4855890 3840 2160
[DEBUG] ff.ll - [va (32) @ 0x7ffaf000a8d0] (3) 17 profiles available
[DEBUG] ff.ll - [va (32) @ 0x7ffaf000a8d0] (3) vaapi_config  0x7ffab4855890
[DEBUG] ff.ll - [va (32) @ 0x7ffaf000a8d0] (3) init: success
[WARN ] ff.ll - [hevc @ 0x7ffab4001680] Using deprecated struct vaapi_context in decode.
[ERROR] ff.ll - [va (32) @ 0x7ffaf000a8d0] (3) No avaiable surface
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] get_buffer() failed
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] thread_get_buffer() failed
[WARN ] ff.ll - [hevc @ 0x7ffab4001680] Error parsing NAL unit #0.
[ERROR] ff.ll - [hw dec @ 0x7ffac57f9578] (3) decode packet: (-12) Cannot allocate memory
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] Could not find ref with POC 21
[ERROR] ff.ll - [va (32) @ 0x7ffaf000a8d0] (3) No avaiable surface
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] get_buffer() failed
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] thread_get_buffer() failed
[WARN ] ff.ll - [hevc @ 0x7ffab4001680] Error parsing NAL unit #0.
[ERROR] ff.ll - [hw dec @ 0x7ffac57f9578] (3) decode packet: (-12) Cannot allocate memory
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] Could not find ref with POC 41
[ERROR] ff.ll - [va (32) @ 0x7ffaf000a8d0] (3) No avaiable surface
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] get_buffer() failed
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] thread_get_buffer() failed
[WARN ] ff.ll - [hevc @ 0x7ffab4001680] Error parsing NAL unit #0.
[ERROR] ff.ll - [hw dec @ 0x7ffac57f9578] (3) decode packet: (-12) Cannot allocate memory
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] Could not find ref with POC 61
[ERROR] ff.ll - [va (32) @ 0x7ffaf000a8d0] (3) No avaiable surface
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] get_buffer() failed
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] thread_get_buffer() failed
[WARN ] ff.ll - [hevc @ 0x7ffab4001680] Error parsing NAL unit #0.
[ERROR] ff.ll - [hw dec @ 0x7ffac57f9578] (3) decode packet: (-12) Cannot allocate memory
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] Could not find ref with POC 81
[ERROR] ff.ll - [va (32) @ 0x7ffaf000a8d0] (3) No avaiable surface
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] get_buffer() failed
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] thread_get_buffer() failed
[WARN ] ff.ll - [hevc @ 0x7ffab4001680] Error parsing NAL unit #0.
[ERROR] ff.ll - [hw dec @ 0x7ffac57f9578] (3) decode packet: (-12) Cannot allocate memory
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] Could not find ref with POC 101
[ERROR] ff.ll - [va (32) @ 0x7ffaf000a8d0] (3) No avaiable surface
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] get_buffer() failed
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] thread_get_buffer() failed
[WARN ] ff.ll - [hevc @ 0x7ffab4001680] Error parsing NAL unit #0.
[ERROR] ff.ll - [hw dec @ 0x7ffac57f9578] (3) decode packet: (-12) Cannot allocate memory
[ERROR] ff.ll - [hevc @ 0x7ffab4001680] Could not find ref with POC 121
User avatar
dolbyman
Guru
Posts: 35248
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: H264+ / H265+ support

Post by dolbyman »

that question needs to be directed to qnap

ask them via ticket (they do not come here)
lucks
New here
Posts: 5
Joined: Fri Jun 21, 2019 5:59 pm

Re: H264+ / H265+ support

Post by lucks »

dolbyman wrote: Fri Jun 21, 2019 9:34 pm that question needs to be directed to qnap

ask them via ticket (they do not come here)
Wait what? What about this - viewtopic.php?t=142969 ?
User avatar
dolbyman
Guru
Posts: 35248
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: H264+ / H265+ support

Post by dolbyman »

what about it ?

once in a blue moon presales people come in(that post is a year old) ..but for issues even they say you need to open a ticket (thats why qnap has a ticket system)
User avatar
rafale
Easy as a breeze
Posts: 350
Joined: Tue May 12, 2015 1:53 pm

Re: H264+ / H265+ support

Post by rafale »

I would say do both. It is ok to post here but also submit a ticket to make sure that QNAP tracks it. Posting here is good for discussion and community awareness' sake but may not get you the answer you need.
Server: TVS-872XT i9 9900 ES, 64GB DDR4 2666MHz, intel X550-T2, Asus RTX3070 Dual OC (On pico PSU), 2x Phison E12 1TB M.2, 4x Micron 5210 7.68TB, 4x WD Purple 4TB
Backup NAS: TS-473 20GB DDR4 2400MHz, Mellanox ConnectX3, 2x Samsung PM871b 256GB M.2, 4x WD Red 8TB
Former units: TVS-1282, TS-871, TS-469
e2204588
Starting out
Posts: 44
Joined: Mon Jun 30, 2014 5:59 pm

Re: H264+ / H265+ support

Post by e2204588 »

"Note that ffmpeg and popular Linux players do support h264+ and h265+ without any issues."
With HW decode enabled?
lucks
New here
Posts: 5
Joined: Fri Jun 21, 2019 5:59 pm

Re: H264+ / H265+ support

Post by lucks »

e2204588 wrote: Wed Jul 03, 2019 9:00 pm "Note that ffmpeg and popular Linux players do support h264+ and h265+ without any issues."
With HW decode enabled?
Yes, I use mpv to preview my camera feed and the CPU load is negligible. I also don't see any decoding artifacts.

That said, I created a ticket for QNAP and got some responses. Official statement is that they do not support "plus" codecs family due to complexity it involves. I pointed out that popular players do support them without issues and Windows QVR Pro also plays H265+ stream w/ hardware decoding enabled. I only got info that they did created internal ticket for tracking purposes but still without any official commitment.

So I guess that software decoding is as much as we can get.

Don't get me wrong, I'm still pretty happy with QVR Pro, especially with the fact that there is actual Linux client. But it's a bit painful seeing better support under Windows + I often use 2-4x playback speed what is absolute no-go on 4k video with sw decoding. I will probably simply try to develop my own simple player if I get too frustrated :).

#markdown
lucks
New here
Posts: 5
Joined: Fri Jun 21, 2019 5:59 pm

Re: H264+ / H265+ support

Post by lucks »

Just wanted to mention that I just upgraded to 1.5.2 and can see vaapi working again, with iHD driver. Thanks for that, much appreciated!

For anyone who's stumbling with red-color-ish artifacts on the screen though, set the environmental variable prior to launching QVR and things will become sane again.

Code: Select all

export allow_rgb10_configs=false
gmora
First post
Posts: 1
Joined: Thu Jul 14, 2022 12:37 am

Re: H264+ / H265+ support

Post by gmora »

Where I can look for an algorithm for decoding h264+ and h265+?
User avatar
dolbyman
Guru
Posts: 35248
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: H264+ / H265+ support

Post by dolbyman »

Those are proprietary codecs used by some IPcams (Hikvision)

https://www.hikvision.com/content/dam/h ... ochure.pdf

As seen further up, ffmpeg supports it
Locked

Return to “Surveillance Solution”