Comments (2)
What if motion is built with rtsp support, but the stream URL is malformed?
from motion.
I can see four possible situations:
- There is RTSP support and the URI is correct.
- There is RTSP support and the URI is malformed.
- RTSP support is missing and the URI is correct and doesn't start by
rtsp://
. - RTSP support is missing and the URI is correct and starts with
rtsp://
. - RTSP support is missing and the URI is malformed.
Currently, the cases 2, 4 and 5 produce all the same “Invalid netcam_url” error. Especially at the level of regular expressions, as currently implemented, there is no way to differentiate the case 4 and 5.
What I suggest is only to make an additional check for the prefix only in the situation where regular expressions fail and the support for RTSP is missing, thus differentiating the case 4 from the case 5. Regular expressions remain unchanged.
I imagine that instead of:
if (!url.host) {
MOTION_LOG(CRT, TYPE_NETCAM, NO_ERRNO, "%s: Invalid netcam_url (%s)",
cnt->conf.netcam_url);
netcam_url_free(&url);
return -1;
}
the changed code will look like this (I haven't written C for the last ten years, so I have no idea about the exact syntax; otherwise I would have forked the project to do the change myself):
if (!url.host) {
char[] error_pattern = "%s: Invalid netcam_url (%s)";
#ifndef have_av_get_media_type_string
// RTSP support is missing.
if (strncmp("rtsp://", tolower(cnt->conf.netcam_url)) == 0) {
error_pattern = "%s: Invalid netcam_url (%s). RTSP is not supported by the current build; consider compiling the application with have_av_get_media_type_string option.";
}
#ifndef
MOTION_LOG(CRT, TYPE_NETCAM, NO_ERRNO, error_pattern,
cnt->conf.netcam_url);
netcam_url_free(&url);
return -1;
}
So:
What if motion is built with rtsp support, but the stream URL is malformed?
This situation is not concerned: only the case where RTSP support is missing is.
from motion.
Related Issues (20)
- If both ffmpeg and extpipe are on - both are executed and write to the same file
- Avi files are always 3 fps HOT 3
- RTSP will not work on authenticated streams
- URLContext and URLProtocol dropped from ffmpeg/libav public API HOT 1
- update to support libav10 HOT 4
- no longer builds for any architecture except x86 HOT 4
- Working version of ffmpeg? HOT 12
- RSTP/RTSP broken in current master HOT 7
- Memory issue in current master HOT 1
- exec_command not working correctly in Cygwin
- integrate Cygwin patch
- Error linking to ffmpeg 2.5 HOT 4
- "Potential split boundary" log message should be suppressed by "netcam_tolerant_check" HOT 5
- More explanation for motion detection algorithm
- How to use ipv6 http stream? HOT 4
- Doesn't work with sricam
- Unknown config option for Database options HOT 1
- RTSP not working HOT 1
- Add webp image compression support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from motion.