Replies: 11 comments 1 reply
-
Hmm....no, I do not see that this patch fixes the issue. I still get the loops and the reconnect:
Also I double checked that the patch did correctly apply. |
Beta Was this translation helpful? Give feedback.
-
Check this patch:
For some reason I cannot force my motion to exit. It finishes reading file, but keeps running for some reason |
Beta Was this translation helpful? Give feedback.
-
Hmm, weired, here it keeps looping, though the "reconnecting ..." in the log
is gone:
[1:ml1:Cam0-replay] [INF] [ALL] [Mar 02 22:45:46] mlp_setupmode: Raw changes:
1663 - changes after 'EedDl': 293 - labels: 2 - noise level: 11
[1:ml1:Cam0-replay] [INF] [ALL] Above message repeats 2 times
[1:ml1:Cam0-replay] [INF] [ALL] [Mar 02 22:45:46] mlp_setupmode: Raw changes:
603 - changes after 'EedDl': 293 - labels: 2 - noise level: 11
[2:nc2:Cam0-replay] [INF] [NET] Above message repeats 3 times
[2:nc2:Cam0-replay] [INF] [NET] [Mar 02 22:45:46] netcam_rtsp_read_image:
Normal resolution: service: file, av_read_frame: End of file, Interrupt: False
[2:nc2:Cam0-replay] [ERR] [NET] [Mar 02 22:45:46] netcam_rtsp_read_image: "End
of file" file:// stream detected, process completed, shutdown
[2:nc2:Cam0-replay] [INF] [NET] [Mar 02 22:45:46] netcam_rtsp_handler: Normal
resolution: Handler loop finished.
[2:nc2:Cam0-replay] [INF] [NET] [Mar 02 22:45:46] netcam_rtsp_handler: netcam
camera handler: finish set, exiting
[1:ml1:Cam0-replay] [INF] [ALL] [Mar 02 22:45:46] mlp_setupmode: Raw changes:
603 - changes after 'EedDl': 293 - labels: 2 - noise level: 11
[1:ml1:Cam0-replay] [INF] [ALL] [Mar 02 22:45:46] mlp_setupmode: Raw changes:
418 - changes after 'EedDl': 293 - labels: 2 - noise level: 11
rd@master:~/tmp.nobackup/git/motion$ git diff
diff --git a/src/netcam_rtsp.c b/src/netcam_rtsp.c
index 63ac614..2de1d8f 100644
--- a/src/netcam_rtsp.c
+++ b/src/netcam_rtsp.c
@@ -616,9 +616,17 @@ static int netcam_rtsp_read_image(struct rtsp_context
*rtsp_data){
if ((rtsp_data->interrupted) || (retcd < 0)) {
av_strerror(retcd, errstr, sizeof(errstr));
MOTION_LOG(INF, TYPE_NETCAM, NO_ERRNO
- ,_("%s: av_read_frame: %s ,Interrupt: %s")
- ,rtsp_data->cameratype
+ ,_("%s: service: %s, av_read_frame: %s, Interrupt: %s")
+ ,rtsp_data->cameratype, rtsp_data->service
,errstr, rtsp_data->interrupted ? _("True"):_("False"));
+ // if processing of file:// completed - shutdown motion
+
+ if (!strcmp(rtsp_data->service, "file") && !strcmp(errstr, "End of
file")) {
+ MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO, "\"%s\" file:// stream
detected, process completed, shutdown", errstr);
+ rtsp_data->status = RTSP_NOTCONNECTED;
+ rtsp_data->finish = TRUE;
+ }
+
my_packet_unref(rtsp_data->packet_recv);
netcam_rtsp_close_context(rtsp_data);
return -1;
rd@master:~/tmp.nobackup/git/motion$
Thanks
Rainer
Am Montag, 2. März 2020, 10:08:42 CET schrieb tosiara:
… Check this path:
```
diff --git a/src/netcam_rtsp.c b/src/netcam_rtsp.c
index 63ac614..2de1d8f 100644
--- a/src/netcam_rtsp.c
+++ b/src/netcam_rtsp.c
@@ -616,9 +616,17 @@ static int netcam_rtsp_read_image(struct rtsp_context
*rtsp_data){ if ((rtsp_data->interrupted) || (retcd < 0)) {
av_strerror(retcd, errstr, sizeof(errstr));
MOTION_LOG(INF, TYPE_NETCAM, NO_ERRNO
- ,_("%s: av_read_frame: %s ,Interrupt: %s")
- ,rtsp_data->cameratype
+ ,_("%s: service: %s, av_read_frame: %s, Interrupt: %s")
+ ,rtsp_data->cameratype, rtsp_data->service
,errstr, rtsp_data->interrupted ? _("True"):_("False"));
+ // if processing of file:// completed - shutdown motion
+
+ if (!strcmp(rtsp_data->service, "file") && !strcmp(errstr, "End
of file")) { + MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO,
"\"%s\" file:// stream detected, process completed, shutdown", errstr); +
rtsp_data->status = RTSP_NOTCONNECTED;
+ rtsp_data->finish = TRUE;
+ }
+
my_packet_unref(rtsp_data->packet_recv);
netcam_rtsp_close_context(rtsp_data);
return -1;
```
For some reason I cannot force my motion to exit. It finishes reading file,
but keeps running for some reason
--
Rainer Dorsch
http://bokomoko.de/
|
Beta Was this translation helpful? Give feedback.
-
Yeah, that's what I see too. The thread exits, but motion keeps running. We need to find a better way to exit motion from within the rtsp code |
Beta Was this translation helpful? Give feedback.
-
Hi tosiara, I came back to this issue now and digged a bit into it. For me it is fixed if I set the context to finish not the rtsp context only (actually, I do not see a difference if I set rtsp context to finish or not):
I have to admit that I have at best a partial understanding of the code, so the change should be reviewed by somebody more knowledgeable. |
Beta Was this translation helpful? Give feedback.
-
Dear All, I encounter the same problem. Endless loop when processing a file. Below is the output for two pass over the same file, with the creation of two identical output.
|
Beta Was this translation helpful? Give feedback.
-
To get around this problem, I have added to my crontab this script that I run every minute when I am using motion. I am sure someone has a better idea.
|
Beta Was this translation helpful? Give feedback.
-
The proposed patch #1122 (comment) no longer works. In the latest version it only cases motion to restart, not quit:
|
Beta Was this translation helpful? Give feedback.
-
This seems to work:
But because of the current issue #1461 motion does not fully exit:
|
Beta Was this translation helpful? Give feedback.
-
I do not believe it would be correct to shutdown after it reaches the end. The looping is exactly what was intended so that parameters can be tuned and evaluated. |
Beta Was this translation helpful? Give feedback.
-
As you can see, there were at least three users who were confused about it. Do you think it is worth to add a configuration param that would control this behavior or we should keep all as is? |
Beta Was this translation helpful? Give feedback.
-
From mail list: https://sourceforge.net/p/motion/mailman/message/36933843/
Since
file://
is used to reprocess recordings either from motion to tune settings, or from 3rd party DVR, it would make sense to exit as soon as the whole file processedCurrent behaivior: rewind the file and start over forever
Suggested patch:
Beta Was this translation helpful? Give feedback.
All reactions