I have a mix of cameras with H.264 and H.265. If I set the bridge’s default codec to H.265, I can connect to any H.265 streams through the bridge but only some H.264 streams. If I set the bridge default codec to H.264, it’s the other way around.
Looking into the bridge RTSP logs, it seems the bridge cannot properly read camera settings from devices that I added using Onvif driver. It uses the default codec when that occurs. See attached log file timestamped 11-43-20.
For an Axis camera that I added using the Axis driver, settings are properly read and I can connect to its H.264 stream even if the bridge default codec is H.265. See attached log file timestamped 12-08-31.
Is there a workaround for this? I add devices using Onvif drivers because some of them do not have specific driver. Thanks
Hi Léo,
That’s a little bit strange. In general it should work with the ONVIF driver.
You are sure that (ONB setting) “Use configuration from cameras” checkbox is checked, right ? And you are using ONVIF driver, but not the RTSP/Universal driver, right ?
But there is a workaround, actually.
It requires a little bit manual work from your side. You can go to the settings of the cameras that do not work and on the “Streams” tab, change the stream name to something that contains codec in it.
For example change from the default “Video Stream 1” to “Video Stream 1 - H.264”. This should solve the issue with those cameras in ONB.
P.S. We wasn’t able to test the ONB with all the camera models that are supported (they more than 10 K after all). But in particular ONVIF driver has been tested with ONB. There is also and TA for that. But I’ll retest it again anyway.
Hi, thanks for the answer.
-
Yes the ‘Use configuration from camera’ is checked
-
I confirm I use ONB (not older Onvif bridge)
-
I confirm I use the Onvif driver, not the Universal
And thanks for the workaround. After adding ‘- H.265’ or ‘- H.264’ in the stream names, I’m able to mix-n-match these two codecs via the ONB.
I still wished it would detect them automatically from camera settings or from parsing NAL units.
Hi Léo,
I’ve tested with few ONVIF cameras (cameras that use ONVIF Driver to connect to the RS).
Seems you are right - for some of them automatic codec detection in the ONB server doesn’t work.
Unfortunately fixing the issue is not so trivial, as it concerns another thing that is still not (fully) implemented. Namely providing support in the ONB for multi-streaming cameras, where different streams use different codecs. For example stream 1 of camera X is set to use H.265 and stream 2 of the same camera X - H.264.
For sure fix won’t be available for the upcoming 2022 R1.
I’ll talk with the PO to see if we can push multi-stream/multi-codec support a little bit upper in the backlog. As it also affects non-multi-stream scenario in some specific cases.
As for detecting codec type from the NAL units - it is not so simple. You know that RTSP server should provide information about the codec on the DESCRIBE command. And it is command that is more like “give me information/meta-data for that video stream”. If we try to consume the actual stream at that point from the RS, there will be entry in the VMS Audit log that user accessed the actual video. But at that point he actually didn’t. Actual consuming happens on the next command - SETUP. And the client could not call that command at all after the DESCRIBE.
And the same is valid for the ONVIF protocol, where client is interested only by the current codec type - in terms of configuration.
Therefore we’ve decided to implement it in this way.
Btw. RTSP protocol is not very flexible in the possibility to dynamically change the codec type. It is negotiated during the “hand-shake” (e.g. DESCRIBE - SETUP) and if it is changed afterwards, server has no any mechanisms to notify the client, except to stop the steam. And the problem is even more difficult to solve if we are handling already recorded video stream with changing codec …