Skip to content
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

Prefer TCP again #658

Merged

Conversation

andrey-utkin
Copy link
Contributor

This changes the behaviour of "Protocol" option of device configuration, which affects how the source RTSP stream is being consumed.

Historically, TCP was preferred.
Then, since
01bac09 ("Refactored input device and added option to select AUTO rtp protocol") UDP with fallback to TCP became the default ("AUTO" mode). This makes picture in recordings prone to smearing, so it was decided to switch back to TCP by default.

Previously, fallback to TCP was done in our code; this commit makes use of FFmpeg's "rtsp_flags=+prefer_tcp" which accomplishes suitable behaviour: try TCP, fallback to UDP.

This changes the behaviour of "Protocol" option of device configuration,
which affects how the source RTSP stream is being consumed.

Historically, TCP was preferred.
Then, since
01bac09 ("Refactored input device and added option to select AUTO rtp protocol")
UDP with fallback to TCP became the default ("AUTO" mode).
This makes picture in recordings prone to smearing, so it was decided to
switch back to TCP by default.

Previously, fallback to TCP was done in our code; this commit makes use
of FFmpeg's "rtsp_flags=+prefer_tcp" which accomplishes suitable
behaviour: try TCP, fallback to UDP.
@andrey-utkin
Copy link
Contributor Author

Tested on Ubuntu 22.04 (Jammy) manually, works as expected.

A way to inspect how the stream is being transmitted is to run

ngrep -t -e -d any tcp  and 'src host' $CAMERA_IP
ngrep -t -e -d any udp  and 'src host' $CAMERA_IP

both at the same time, and see where the traffic happens.

There is an existing bug that switching "Protocol" setting requires a service restart (systemctl restart bluecherry), we'll get to that separately.

@curtishall curtishall merged commit fce49bc into bluecherrydvr:master Feb 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants