-
Notifications
You must be signed in to change notification settings - Fork 789
onvif: Add Support for Camera Names and Main/Sub stream #1654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
streamthing
wants to merge
12
commits into
AlexxIT:master
Choose a base branch
from
streamthing:onvif-osd-mainsubstream
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+210
−30
Open
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3ed4928
onvif: Add Support for Camera Names and Main/Sub stream
streamthing 92749fe
remove my debug
streamthing 44a5624
remove debug code
streamthing 65a5138
Change `id` to `index`
streamthing f953273
remove index from OnvifCamera
streamthing 05a13bc
Add ONVIF module to README.md
streamthing 030611a
add information about onvif module in hass section
streamthing 253f8ec
fix README.md
streamthing bdb9da8
Change config style, OnvifCameras -> OnvifProfiles, add stream arguments
streamthing 50884f8
update README.md with new config style
streamthing 35f5818
Update README.md with fixed example config
streamthing 72b04e6
fix: translate polish comment
streamthing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,6 +86,7 @@ Ultimate camera streaming application with support RTSP, WebRTC, HomeKit, FFmpeg | |
| * [Module: MP4](#module-mp4) | ||
| * [Module: HLS](#module-hls) | ||
| * [Module: MJPEG](#module-mjpeg) | ||
| * [Module: ONVIF](#module-onvif) | ||
| * [Module: Log](#module-log) | ||
| * [Security](#security) | ||
| * [Codecs filters](#codecs-filters) | ||
|
|
@@ -1208,6 +1209,46 @@ API examples: | |
|
|
||
| [](https://www.youtube.com/watch?v=sHj_3h_sX7M) | ||
|
|
||
| ### Module: ONVIF | ||
|
|
||
| This module provides an **ONVIF server** that allows go2rtc to act as an ONVIF-compatible device, making it easier to integrate cameras with ONVIF-supported software like Dahua NVRs or Home Assistant. | ||
|
|
||
| With ONVIF support, go2rtc can: | ||
| - Expose configured streams as ONVIF profiles. | ||
| - Provide additional ONVIF functionalities like `GetOSDs` to show camera name in Dahua NVR. | ||
| - Maintain a **consistent camera order** to prevent issues with NVRs that rely on `GetProfilesResponse` for identification. | ||
|
|
||
| **Example Configuration** | ||
|
|
||
| ```yaml | ||
| onvif: | ||
| - name: Camera 1 | ||
| main_stream: camera1 | ||
| sub_stream: camera1_lq | ||
| - name: Camera 2 | ||
| main_stream: camera2 | ||
| sub_stream: camera2_lq | ||
|
|
||
| streams: | ||
| camera1: | ||
| - rtsp://admin:[email protected]/cam/realmonitor?channel=1&subtype=0&unicast=true | ||
| camera1_lq: | ||
| - ffmpeg:camera1#video=h264#height=360 | ||
| camera2: | ||
| - rtsp://admin:[email protected]/cam/realmonitor?channel=1&subtype=0&unicast=true | ||
| camera2_lq: | ||
| - ffmpeg:camera2#video=h264#height=360 | ||
| ``` | ||
|
|
||
| **Example Dahua NVR configuration:** | ||
| - **Channel**: <camera channel on NVR> | ||
| - **Manufacturer**: ONVIF | ||
| - **IP Address**: <go2rtc IP> | ||
| - **RTSP Port**: Self-adaptive | ||
| - **HTTP Port**: <go2rtc http api port, eg. 1984> | ||
| - **Username / Password**: Currently auth is not supported by go2rtc | ||
| - **Remote CH No.**: <camera index from onvif array, counting from 1> | ||
|
|
||
streamthing marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ### Module: Log | ||
|
|
||
| You can set different log levels for different modules. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should think on how this config will look like in the future. How about:
The first
streamwould always be mainstream, while the second would be substream if present.By the way some cameras have additional streams, how are they usually exposed in this case? Maybe we should support it too.
This approach is better because it doesn't require to document
third_stream,fourth_stream, options. Also, it's less things to type.As per resolution, maybe this?
Very go2rtc-style. :)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing is, you are adding
onvifat the top as an array of cameras. But what if in the future we may want to other introduceonvifglobal configurations?To protect against this, I think you should make it a nested option within the top
onviflike this:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for feedback.
I changed
OnvifCamerastoOnvifProfilesand added function to parse stream arguments (res, codec).New config:
By default:
res=1920x1080codec=H264