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