H264+ / H265+ support

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

H264+ / H265+ support

Post by lucks » Fri Jun 21, 2019 6:12 pm

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

dolbyman
Guru
Posts: 14720
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: H264+ / H265+ support

Post by dolbyman » Fri Jun 21, 2019 9:34 pm

that question needs to be directed to qnap

ask them via ticket (they do not come here)

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

Re: H264+ / H265+ support

Post by lucks » Fri Jun 21, 2019 9:42 pm

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 ?

dolbyman
Guru
Posts: 14720
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: H264+ / H265+ support

Post by dolbyman » Fri Jun 21, 2019 10:43 pm

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
Getting the hang of things
Posts: 97
Joined: Tue May 12, 2015 1:53 pm

Re: H264+ / H265+ support

Post by rafale » Sat Jun 22, 2019 3:28 am

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.
TVS 1282, i7 6700K, Emulex OCe11102 dual 10GBe Card, 64GB, 2xMicron1100 2TB SATA, 2x Crucial C300 128GB Cache, 2x850 EVO 500GB M.2. 4x WD Red 8TB, 4x WD Purple 4TB

e2204588
Starting out
Posts: 28
Joined: Mon Jun 30, 2014 5:59 pm

Re: H264+ / H265+ support

Post by e2204588 » 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?

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

Re: H264+ / H265+ support

Post by lucks » Mon Jul 08, 2019 4:51 am

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

Post Reply

Return to “Surveillance Solution”