libonvif icon indicating copy to clipboard operation
libonvif copied to clipboard

H265 is not supported!

Open NacerFaraj opened this issue 10 months ago • 2 comments

There are some bugs I believe:

  1. While the codec in camera's panel is set to H265, onvif-util returns H264.
  2. Even I set the encoder to H264 via onvif-util, it remains H265.

I tired this with different cameras. And the results were the same!

NacerFaraj avatar Mar 04 '25 08:03 NacerFaraj

Thank you so much for reaching out, your interest in the project is greatly appreciated. You are correct that H265 is not supported in the current version. The reason for this is historical. When this project was first developed, the primary ONVIF profile in existence was profile S, which does not have support for H265. Recently, profile T, which does include support for H265, has become more common.

It should be possible to add this functionality to the library, but it does entail significant effort. If I may digress, the historical context may provide a better understanding of the current state. The library was never intended to be a comprehensive implementation of the ONVIF standard, and you may notice that a large number of ONVIF features are missing. It was developed at a time when there were not any existing tools to perform this function.

If you are familiar with the ONVIF specification, it uses the SOAP protocol, which creates applications based on an XML template file that includes all of the details of the protocol communications. The XML file is processed by a SOAP application that generates code that can be used to compile a program that communicates with the cameras using the protocol specified by the original XML document. If this sounds odd, that's because it is. The implications of this type of implementation are that the program developed with this kind of code is awkward to integrate into a larger project. At the time, there were also bugs in the SOAP generator that caused difficulty in communicating with certain cameras.

This library was developed in response to those conditions, and it does not depend on the SOAP application to generate code. It basically is a reverse engineering of the protocol based on an interpretation of the XML protocol specification and observation of the protocol in action on the network. During development, it was observed that the vast majority of cameras implement only a very small subset of available ONVIF commands, so development continued only to the point where most of the commands were implemented by most of the the cameras.

It is unfortunate that the original profile S does not support H265, as it would not have been that difficult to do at the time. I may get around to reverse engineering portions of the T profile to add those functions, but it is not really a priority at this time. There are plenty of other libonvifs out there that you could try that might give better results.

Best Regards,

Stephen

sr99622 avatar Mar 04 '25 17:03 sr99622

Thank you, Stephen, for the clear explanation. I hope someone can contribute and add this feature to the library. By the way, the library is incredibly useful and covers the most essential features.

NacerFaraj avatar Mar 04 '25 19:03 NacerFaraj