Unable To Differentiate RTSP Sources
Introduction
BirdNET-Go is a powerful tool for detecting bird species using machine learning algorithms and RTSP streams from microphones. However, a recent change in the stripping of credentials from MQTT messages has led to a critical issue where detections are no longer associated with a specific RTSP stream. This article will delve into the problem, its impact, and possible solutions to resolve this issue.
The Problem
The issue arises when two microphones are set up to stream to a mediamtx server, and BirdNET-Go pulls these two RTSP streams from rtsp://<mediamtxserver>:8554/birdmic1
and rtsp://<mediamtxserver>:8554/birdmic2
. After stripping the credentials from MQTT messages, all detections get added to the database with the source field set to rtsp://<mediamtxserver>:8554
. This means that it is no longer possible to associate a detection with a particular microphone, which is a critical feature for users querying the database directly.
Impact
For users like the one who reported this issue, this problem is particularly frustrating. One of the microphones is set up in an area frequented by "traditional" garden birds, whereas the other is designed to detect farmland species. This makes it challenging to analyze and understand the bird species detected by each microphone. While this may be a niche or unintended use-case, it highlights the importance of being able to associate detections with specific RTSP streams.
Steps to Reproduce
To reproduce this issue, follow these steps:
- Setup 2 microphones to stream to a mediamtx server: Set up two microphones to stream to a mediamtx server. This can be done using a variety of methods, including using a mediamtx server and configuring the microphones to stream to it.
- Configure BirdNET-Go to pull the 2 streams from the mediamtx server: Configure BirdNET-Go to pull the two RTSP streams from the mediamtx server. This can be done by editing the configuration file and specifying the RTSP streams to pull.
- Note that detections appear in the
notes
table containing the same source: After configuring BirdNET-Go to pull the two RTSP streams, note that detections appear in thenotes
table containing the same source.
Expected Behavior
The expected behavior is that detections can be associated with a specific RTSP stream. This means that when a detection is made, the source field in the database should contain the specific RTSP stream that made the detection.
Actual Behavior
The actual behavior is that detections are not associated with a specific RTSP stream. This means that when a detection is made, the source field in the database contains the same RTSP stream for all detections, regardless of which microphone made the detection.
Environment
The environment in which this issue was encountered is as follows:
- Version Information (build date):
BirdNET-Go v0.6.3 (built: 2025-03-08T09:35:32Z)
- System Information:
- Device: Kubernetes
- OS: Ubuntu
- OS Version: 22.04 LTS
- Hardware specs: Ryzen 7 5825U, 32GB RAM, 500GB SSD
- For Non-Raspberry Pi Linux Users: Yes, the issue was tested with the latest dev branch container image.
Possible Solution
One possible solution to this issue is to allow a name to be assigned to an RTSP stream that can then be used as the source. Alternatively, a way to configure how/if RTSP URLs are stripped of credentials could be implemented. This would enable users to associate detections with specific RTSP streams, making it easier to analyze and understand the bird species detected by each microphone.
Q: What is the issue with BirdNET-Go and RTSP sources?
A: The issue is that after stripping the credentials from MQTT messages, all detections get added to the database with the source field set to rtsp://<mediamtxserver>:8554
. This means that it is no longer possible to associate a detection with a particular microphone.
Q: Why is this a problem?
A: This is a problem because it makes it challenging to analyze and understand the bird species detected by each microphone. For users like the one who reported this issue, this is particularly frustrating because one of the microphones is set up in an area frequented by "traditional" garden birds, whereas the other is designed to detect farmland species.
Q: How can I reproduce this issue?
A: To reproduce this issue, follow these steps:
- Setup 2 microphones to stream to a mediamtx server: Set up two microphones to stream to a mediamtx server. This can be done using a variety of methods, including using a mediamtx server and configuring the microphones to stream to it.
- Configure BirdNET-Go to pull the 2 streams from the mediamtx server: Configure BirdNET-Go to pull the two RTSP streams from the mediamtx server. This can be done by editing the configuration file and specifying the RTSP streams to pull.
- Note that detections appear in the
notes
table containing the same source: After configuring BirdNET-Go to pull the two RTSP streams, note that detections appear in thenotes
table containing the same source.
Q: What is the expected behavior?
A: The expected behavior is that detections can be associated with a specific RTSP stream. This means that when a detection is made, the source field in the database should contain the specific RTSP stream that made the detection.
Q: What is the actual behavior?
A: The actual behavior is that detections are not associated with a specific RTSP stream. This means that when a detection is made, the source field in the database contains the same RTSP stream for all detections, regardless of which microphone made the detection.
Q: What is the environment in which this issue was encountered?
A: The environment in which this issue was encountered is as follows:
- Version Information (build date):
BirdNET-Go v0.6.3 (built: 2025-03-08T09:35:32Z)
- System Information:
- Device: Kubernetes
- OS: Ubuntu
- OS Version: 22.04 LTS
- Hardware specs: Ryzen 7 5825U, 32GB RAM, 500GB SSD
- For Non-Raspberry Pi Linux Users: Yes, the issue was tested with the latest dev branch container image.
Q: What is a possible solution to this issue?
A: One possible solution to this issue is to allow a name to be assigned to an RTSP stream that can then be used as the source. Alternatively, a way to configure how/if RTSP URLs are stripped of credentials could be implemented. This would enable users to associate detections with specific RTSP streams, making it easier to analyze and understand the bird species detected by each microphone.
Q: How can I help resolve this issue?
A: If you are experiencing this issue, please report it to the BirdNET-Go team with as much detail as possible. This will help the team to reproduce the issue and work towards a solution. Additionally, if you have any suggestions for how to resolve this issue, please share them with the team.