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

Camera stop working / stream if save video in HDD #1770

Closed
gui59169 opened this issue Jan 8, 2019 · 16 comments
Closed

Camera stop working / stream if save video in HDD #1770

gui59169 opened this issue Jan 8, 2019 · 16 comments

Comments

@gui59169
Copy link

gui59169 commented Jan 8, 2019

motionEyeOS Version

I am running motionEyeOS version: motionEyeOS 20181209

Board Model

I am using the following board/model: Raspberry PI 2B+

Camera

I am using the following type of camera: 3x IP camera with RTSP stream connected by Ethernet

My camera model is: Besder camera / IPC / Chinese

Network Connection

My motionEyeOS unit is connected to the network via: Ethernet

Peripherals

I am using the following peripherals that I consider relevant to this issue:
External HDD

I got 3 cameras ( same brand, chinese), only one is continuous recording, other only show the stream for testing.

After some time (some hours, arround 10 hours), camera stop the live stream only when i ask to continuous recording...
I have tried with different file size, like 60sec, 120sec, 3600sec... Same troubles.;; Camera stop working and recording + live stream broken ( grey image with barred camera logo).

2 others cameras (which not setup for recording) are always showing their live stream without any trouble.

To enable it a new time i just need to change a setup like frame rate or camera name, and recording + live stream is ok for some hours...

This is the log in debug mode when camera stop live stream and stop recording without any reason.

motion.log :
[3:ml3] [INF] [EVT] event_new_video: Source FPS 9
[3:ml3] [NTC] [ENC] ffmpeg_set_codec: Using codec h264_omx
[3:ml3] [INF] [ENC] ffmpeg_set_quality: h264_omx codec vbr/crf/bit_rate: 6480000
[3:ml3] [NTC] [EVT] event_newfile: File of type 8 saved to: /data/media/sda5/FACADE/2019-01-08/07-14-11.mp4
[3:ml3] [NTC] [ALL] motion_detected: Motion detected - starting event 391
[3:ml3] [DBG] [ENC] ffmpeg_encode_video: Receive packet threw EAGAIN returning -2 code :Resource temporarily unavailable
[3:ml3] [DBG] [ENC] ffmpeg_put_image: Buffered packet
[3:ml3] [DBG] [ENC] ffmpeg_encode_video: Receive packet threw EAGAIN returning -2 code :Resource temporarily unavailable
[3:ml3] [DBG] [ENC] ffmpeg_put_image: Buffered packet
......
.....
[0:motion] [ERR] [ALL] main: Thread 3 - Watchdog timeout, trying to do a graceful restart
[0:motion] [ERR] [ALL] main: Thread 3 - Watchdog timeout, did NOT restart graceful, killing it!
[0:motion] [ERR] [ALL] main: cleaning Thread 3
[0:motion] [NTC] [STR] stream_stop: Closing motion-stream listen socket & active motion-stream sockets
[0:motion] [NTC] [STR] stream_stop: Closed motion-stream listen socket & active motion-stream sockets
[0:motion] [DBG] [EVT] exec_command: Executing external command '/usr/lib/python2.7/site-packages/motioneye/scripts/relayevent.sh "/data/etc/motioneye.conf" stop 3'
[7:nc7] [INF] [ENC] ffmpeg_avcodec_log: left block unavailable for requested intra4x4 mode -1
[7:nc7] [INF] [ENC] ffmpeg_avcodec_log: error while decoding MB 0 29, bytestream 77624
[6:nc6] [INF] [ENC] ffmpeg_avcodec_log: Increasing reorder buffer to 1

motioneye.log
2019-01-08 07:13:42: [motioneye] DEBUG: running cleanup process...
2019-01-08 07:13:42: [motioneye] DEBUG: cleaning up pictures...
2019-01-08 07:13:42: [motioneye] DEBUG: cleaning up movies...
2019-01-08 07:13:43: [motioneye] DEBUG: cleanup done
2019-01-08 07:13:47: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 19.01ms
2019-01-08 07:13:52: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 13.80ms
2019-01-08 07:13:57: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.92ms
2019-01-08 07:14:02: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 5.31ms
2019-01-08 07:14:08: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 6.96ms
2019-01-08 07:14:13: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 11.56ms
2019-01-08 07:14:13: [motioneye] DEBUG: received relayed event stop for thread id 3 (camera id 6)
2019-01-08 07:14:13: [motioneye] DEBUG: clearing motion detected for camera with id 6
2019-01-08 07:14:13: [motioneye] DEBUG: 200 POST /_relay_event/?_username=admin&event=stop&thread_id=3&_signature=3f0f746beb1a2940d05a4b4dd71224d1e42746db (127.0.0.1) 49.54ms
2019-01-08 07:14:13: [motioneye] DEBUG: received relayed event movie_end for thread id 3 (camera id 6)
2019-01-08 07:14:13: [motioneye] DEBUG: adding task "make_movie_preview(/data/media/sda5/FACADE/2019-01-08/07-12-11.mp4)" in 5 seconds
2019-01-08 07:14:13: [motioneye] DEBUG: saving tasks to "/data/etc/tasks.pickle"...
2019-01-08 07:14:13: [motioneye] DEBUG: 200 POST /_relay_event/?_username=admin&event=movie_end&thread_id=3&_signature=d46b53df93460aadb76206d570406dec1a57e832 (127.0.0.1) 67.79ms
2019-01-08 07:14:13: [motioneye] DEBUG: received relayed event start for thread id 3 (camera id 6)
2019-01-08 07:14:13: [motioneye] DEBUG: ignoring start event for camera with id 6 and motion detection disabled
2019-01-08 07:14:13: [motioneye] DEBUG: 200 POST /_relay_event/?_username=admin&event=start&thread_id=3&_signature=f617de658b00962d43e4f9bf0e5be839388ed203 (127.0.0.1) 50.87ms
2019-01-08 07:14:18: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.36ms
2019-01-08 07:14:20: [motioneye] DEBUG: executing task "make_movie_preview(/data/media/sda5/FACADE/2019-01-08/07-12-11.mp4)"
2019-01-08 07:14:20: [motioneye] DEBUG: saving tasks to "/data/etc/tasks.pickle"...
2019-01-08 07:14:20: [motioneye] DEBUG: creating movie preview for /data/media/sda5/FACADE/2019-01-08/07-12-11.mp4 with an offset of 4 seconds...
2019-01-08 07:14:20: [motioneye] DEBUG: running command "ffmpeg -i /data/media/sda5/FACADE/2019-01-08/07-12-11.mp4 -f mjpeg -vframes 1 -ss 4 -y /data/media/sda5/FACADE/2019-01-08/07-12-11.mp4.thumb"
2019-01-08 07:14:23: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 17.33ms
2019-01-08 07:14:28: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.98ms
2019-01-08 07:14:33: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.28ms
2019-01-08 07:14:38: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.53ms
2019-01-08 07:14:44: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 9.18ms
2019-01-08 07:14:49: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.70ms
2019-01-08 07:14:54: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 5.13ms
2019-01-08 07:14:59: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 16.95ms
2019-01-08 07:15:04: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.90ms
2019-01-08 07:15:09: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.61ms
2019-01-08 07:15:14: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 10.28ms
2019-01-08 07:15:20: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.40ms
2019-01-08 07:15:25: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 8.83ms
2019-01-08 07:15:30: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 5.82ms
2019-01-08 07:15:35: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.43ms
2019-01-08 07:15:39: [motioneye] ERROR: mjpg client timed out receiving data for camera 6 on port 8086
2019-01-08 07:15:40: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 9.68ms
2019-01-08 07:15:45: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 5.22ms
2019-01-08 07:15:49: [motioneye] ERROR: mjpg client timed out receiving data for camera 6 on port 8086
2019-01-08 07:15:50: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 5.31ms
2019-01-08 07:15:56: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 7.65ms
2019-01-08 07:15:59: [motioneye] ERROR: mjpg client timed out receiving data for camera 6 on port 8086
2019-01-08 07:16:01: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 5.68ms
2019-01-08 07:16:06: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 3.76ms
2019-01-08 07:16:09: [motioneye] ERROR: mjpg client timed out receiving data for camera 6 on port 8086
2019-01-08 07:16:11: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 5.72ms
2019-01-08 07:16:16: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 21.90ms
2019-01-08 07:16:19: [motioneye] ERROR: mjpg client timed out receiving data for camera 6 on port 8086
2019-01-08 07:16:21: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.52ms
2019-01-08 07:16:26: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.25ms
2019-01-08 07:16:29: [motioneye] ERROR: mjpg client timed out receiving data for camera 6 on port 8086
2019-01-08 07:16:31: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.72ms
2019-01-08 07:16:37: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 5.97ms
2019-01-08 07:16:39: [motioneye] ERROR: mjpg client timed out receiving data for camera 6 on port 8086
2019-01-08 07:16:42: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.46ms
2019-01-08 07:16:47: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 14.79ms
2019-01-08 07:16:49: [motioneye] ERROR: mjpg client timed out receiving data for camera 6 on port 8086
2019-01-08 07:16:52: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.41ms
2019-01-08 07:16:53: [motioneye] DEBUG: connection closed for mjpg client for camera 6 on port 8086
2019-01-08 07:16:53: [motioneye] DEBUG: mjpg client for camera 6 on port 8086 removed
2019-01-08 07:16:54: [motioneye] DEBUG: received relayed event stop for thread id 3 (camera id 6)
2019-01-08 07:16:54: [motioneye] DEBUG: clearing motion detected for camera with id 6
2019-01-08 07:16:54: [motioneye] DEBUG: 200 POST /_relay_event/?_username=admin&event=stop&thread_id=3&_signature=3f0f746beb1a2940d05a4b4dd71224d1e42746db (127.0.0.1) 24.27ms
2019-01-08 07:16:57: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 13.61ms
2019-01-08 07:17:02: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.67ms
2019-01-08 07:17:07: [motioneye] DEBUG: 200 HEAD / (127.0.0.1) 4.51ms

@gui59169
Copy link
Author

gui59169 commented Jan 8, 2019

#1729

@gui59169
Copy link
Author

Tested, last two days with h264 codec and it’s working. No Interrupt.

It’s seems OMX codec is the source of troubles

@jasaw
Copy link
Collaborator

jasaw commented Jan 18, 2019

@gui59169 Please try dev20190118. It should fix your problem. Please report back whether it works for you or not.

@gui59169
Copy link
Author

I will have a try and keeping you informed. Thanks

@jasaw
Copy link
Collaborator

jasaw commented Jan 20, 2019

The dev20190118 is now version 20190119, which should fix your OMX problem.

@gui59169
Copy link
Author

gui59169 commented Jan 21, 2019

The dev20190118 is now version 20190119, which should fix your OMX problem.

I'm sorry to tell you that....
dev20190119 do not solve the OMX trouble, same problem happens as 1st post.

No troubles with .mov or .mp4 (H264) . only happens with H264OMX after some hours/minutes of recording

@gui59169
Copy link
Author

gui59169 commented Jan 21, 2019

capture d ecran 2019-01-21 a 21 19 06

on this screenshot

1st camera not configured as continuous recording is always working and showing stream

4 others (configured as continuous recording) stops showing stream / stops recording ( bared camera logo)

@jasaw
Copy link
Collaborator

jasaw commented Jan 21, 2019

How much memory did you allocate to the GPU?
Please run vcgencmd get_mem malloc ; vcgencmd get_mem reloc periodically to make sure you have allocated enough memory for the GPU.
Please test with 1 camera, continuous recording. When the camera stream fails, attach all the log files and your thread-1.conf file here.

@gui59169
Copy link
Author

GPU 256.
Very hard to see when it fail because it could be 1h like 20hours...

I will do this test, really want to solve this trouble with omx.

@gui59169
Copy link
Author

2 days later it seems to recording without trouble, let's see what happen in next days. motionEyeOS 20190119

@gui59169
Copy link
Author

No more camera live stream...(only when continuous recording in H264OMX) I will be back with some debug logs later.

@jasaw
Copy link
Collaborator

jasaw commented Jan 30, 2019

@gui59169 Just to be clear, your camera still stops working even with only one camera configured on the system?

@gui59169
Copy link
Author

@gui59169 Just to be clear, your camera still stops working even with only one camera configured on the system?

I'm also making some tests... also my sd crashed last week :(

@gui59169
Copy link
Author

gui59169 commented Mar 2, 2019

Since one week it's continuous recording for 2 cameras without any troubles with OMX codec. (raspberry 2b+)
I'm now trying with 3 cams.
using motionEyeOS 20190119.

@gui59169
Copy link
Author

using motionEyeOS 20190119 and recording for 3 cameras. No more stops !

I have changed the power supply and micro sd card by a good one (maybe that was the problem......)
OR
your update is great.

motioneyesOS is a very good software !

@ccrisan
Copy link
Collaborator

ccrisan commented Mar 13, 2019

@gui59169 thanks for letting us know that the problem has been solved.

@ccrisan ccrisan closed this as completed Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants