roflcoopter / viseron

Self-hosted, local only NVR and AI Computer Vision software. With features such as object detection, motion detection, face recognition and more, it gives you the power to keep an eye on your home, office or any other place you want to monitor.
MIT License
1.5k stars 154 forks source link

No recordings found m3u8 file not being saved/generated. #737

Open usaraj opened 2 months ago

usaraj commented 2 months ago

Thanks for this repository. Please review the following issue and your help to troubleshoot will be greatly appreciated.

Viseron 3.0.0.b3 docker image for linux_amd_64_gpu/cuda om Ubuntu + Nvidia GPU

Configured and can view the camera stream. Motion detection is working. Object detection not yet tested.

Issue arising when accessing the recordings. Clicking on splash/image returns error: The media could not be loaded.

debug info (truncated) follows:

[2024-04-30 15:39:54] [DEBUG ] [viseron.states] - Setting state of binary_sensor.camera_2_recorder to state: off, attributes {'name': 'Kitchen Recorder', 'domain': 'binary_sensor', 'id': 2285, 'start_time': datetime.datetime(2024, 4, 30, 20, 39, 45, 957117, tzinfo=datetime.timezone.utc), 'start_timestamp': 1714509585.957117, 'end_time': datetime.datetime(2024, 4, 30, 20, 39, 54, 473720, tzinfo=datetime.timezone.utc), 'end_timestamp': 1714509594.47372, 'date': '2024-04-30', 'path': '/recordings/camera_2/2024-04-30/20:39:45.mp4', 'filename': '20:39:45.mp4', 'thumbnail_path': '/thumbnails/camera_2/2285.jpg', 'objects': []} [2024-04-30 15:39:54] [DEBUG ] [viseron.states] - Setting state of sensor.camera_2_operation_state to state: scanning_for_motion, attributes {'name': 'Kitchen Operation State', 'domain': 'sensor'}

Web debug: [2024-04-30 15:40:05] [DEBUG ] [viseron.components.webserver.api.handlers] - Routing to HlsAPIHandler.get_recording_hls_playlist(*args=[], **kwargs={'camera_identifier': 'camera_2', 'recording_id': '2285'}, request_arguments={}) [2024-04-30 15:40:05] [ERROR ] [viseron.components.webserver.api.v1.hls] - Could not find init.mp4 file for camera camera_2 [2024-04-30 15:40:05] [WARNING ] [tornado.access] - 404 GET /api/v1/hls/camera_2/2285/index.m3u8 (64.135.196.78) 93.58ms

There are no mp4 file in the recordings/camera_2 folder

There is no index.m3u8 file to access as reflected in the logs.

thumbnail jpg files are being generated and show up in events page. But when clicked results in error mentioned above

Camera configuration:

camera_2:  # This value has to be unique across all cameras
  name: Kitchen
  host: <000.000.000.000>
  port: 554
  path: /h264.mp4
  username: <user>
  password: <pass>
  codec: h264_cuvid
  audio_codec: aac
  height: 1080
  width: 1920
  fps: 5
  raw_command: ffmpeg -hide_banner -loglevel error -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts -use_wallclock_as_timestamps 1 -vsync 0 -c:v h264_cuvid -rtsp_transport tcp -i rtsp://user:pass@192.168.1.000:554/h264.mp4 -f rawvideo -pix_fmt nv12 pipe:1

Thanks for your help in advance.

roflcoopter commented 2 months ago

Do you have any files in the /segments folder?

usaraj commented 2 months ago

No. the /segments folder has empty sub-folders like /segments/camera_X for the configured camera. Thanks

roflcoopter commented 2 months ago

And you have no errors in the log when starting up Viseron?

usaraj commented 2 months ago

Here are some more debug logs

[2024-05-01 14:39:45] [DEBUG ] [viseron.domains.camera.fragmenter.camera_2] - Checking for new segments to fragment [2024-05-01 14:39:49] [DEBUG ] [viseron.components.ffmpeg.camera.camera_2] - Timed out trying to stop camera. Killing pipe [2024-05-01 14:39:50] [ERROR ] [viseron.watchdog.thread_watchdog] - Thread viseron.camera.camera_2 is dead, restarting [2024-05-01 14:39:50] [DEBUG ] [viseron.components.ffmpeg.camera.camera_2] - Starting capture thread [2024-05-01 14:39:50] [DEBUG ] [viseron.states] - Setting state of toggle.camera_2_connection to state: off, attributes {'name': 'Kitchen Connection', 'domain': 'toggle'} [2024-05-01 14:39:50] [DEBUG ] [viseron.watchdog] - Registering <RestartableThread(viseron.camera.camera_2, initial daemon)> in the watchdo g [2024-05-01 14:39:50] [DEBUG ] [viseron.components.ffmpeg.stream.camera_2] - FFmpeg decoder command: ffmpeg -hide_banner -loglevel error -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts -use_wallclock_as_timestamps 1 -vsync 0 -c:v h264_cuvid -rtsp_transport tcp -i rtsp://:@192.168.1.168:554/h264.mp4 -f rawvideo -pix_fmt nv12 pipe:1 [2024-05-01 14:39:50] [DEBUG ] [viseron.states] - Setting state of toggle.camera_2_connection to state: on, attributes {'name': 'Kitchen Co nnection', 'domain': 'toggle'} [2024-05-01 14:39:50] [DEBUG ] [viseron.domains.camera.fragmenter.camera_2] - Checking for new segments to fragment [2024-05-01 14:39:52] [DEBUG ] [viseron.components.webserver.api.handlers] - Routing to CameraAPIHandler.get_snapshot(*args=[], kwargs={' camera_identifier': 'camera_2'}, request_arguments={'rand': 'u9vyoh', 'width': 666, 'access_token': ****, 'height': None}) [2024-05-01 14:39:52] [ERROR ] [tornado.access] - 500 GET /api/v1/camera/camera_2/snapshot?rand=u9vyoh&width=666 (64.135.196.78) 10.56ms [2024-05-01 14:39:55] [DEBUG ] [viseron.domains.camera.fragmenter.camera_2] - Checking for new segments to fragment [2024-05-01 14:39:56] [DEBUG ] [viseron.states] - Setting state of binary_sensor.camera_2_connected to state: on, attributes {'name': 'Kitchen Connected', 'domain': 'binary_sensor'} [2024-05-01 14:39:56] [DEBUG ] [viseron.components.nvr.nvr.camera_2] - First frame received [2024-05-01 14:39:56] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.99334 [2024-05-01 14:39:56] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Motion detected [2024-05-01 14:39:56] [DEBUG ] [viseron.states] - Setting state of binary_sensor.camera_2_motion_detected to state: on, attributes {'name': 'Kitchen Motion Detected', 'domain': 'binary_sensor'} [2024-05-01 14:39:56] [INFO ] [viseron.components.ffmpeg.recorder.camera_2] - Starting recorder [2024-05-01 14:39:56] [DEBUG ] [viseron.components.ffmpeg.recorder.camera_2] - Saving thumbnail in /thumbnails/camera_2 [2024-05-01 14:39:56] [DEBUG ] [viseron.components.storage.tier_handler.camera_2.tier_0] - File created: /thumbnails/camera_2/2591.jpg [2024-05-01 14:39:56] [DEBUG ] [viseron.states] - Setting state of binary_sensor.camera_2_recorder to state: on, attributes {'name': 'Kitch en Recorder', 'domain': 'binary_sensor', 'id': 2591, 'start_time': datetime.datetime(2024, 5, 1, 19, 39, 56, 446489, tzinfo=datetime.timezone .utc), 'start_timestamp': 1714592396.446489, 'end_time': None, 'end_timestamp': None, 'date': '2024-05-01', 'path': '/recordings/camera_2/202 4-05-01/19:39:56.mp4', 'filename': '19:39:56.mp4', 'thumbnail_path': '/thumbnails/camera_2/2591.jpg', 'objects': []} [2024-05-01 14:39:56] [DEBUG ] [viseron.states] - Setting state of image.camera_2_latest_thumbnail to state: unknown, attributes {'name': ' Kitchen Latest Thumbnail', 'domain': 'image', 'start_time': '2024-05-01T19:39:56.446489+00:00', 'path': '/recordings/camera_2/2024-05-01/19:3 9:56.mp4', 'thumbnail_path': '/thumbnails/camera_2/2591.jpg'} [2024-05-01 14:39:56] [DEBUG ] [viseron.states] - Setting state of sensor.camera_2_operation_state to state: recording, attributes {'name': 'Kitchen Operation State', 'domain': 'sensor'} [2024-05-01 14:39:56] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.01018 [2024-05-01 14:39:56] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Motion stopped [2024-05-01 14:39:56] [DEBUG ] [viseron.states] - Setting state of binary_sensor.camera_2_motion_detected to state: off, attributes {'name' : 'Kitchen Motion Detected', 'domain': 'binary_sensor'} [2024-05-01 14:39:56] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 9 [2024-05-01 14:39:57] [DEBUG ] [viseron.components.storage.tier_handler.camera_2.tier_0] - File modified (delayed event): /thumbnails/camer a_2/2591.jpg [2024-05-01 14:39:58] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.01397 [2024-05-01 14:39:58] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 8 [2024-05-01 14:39:58] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.01576 [2024-05-01 14:39:59] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 7 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.01666 [2024-05-01 14:39:59] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 6 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.01749 [2024-05-01 14:39:59] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 5 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.01858 [2024-05-01 14:39:59] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 4 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.02232 [2024-05-01 14:39:59] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 3 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.02203 [2024-05-01 14:39:59] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 2 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.02198 [2024-05-01 14:39:59] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 1 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.02201 [2024-05-01 14:39:59] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 0 [2024-05-01 14:39:59] [INFO ] [viseron.components.ffmpeg.recorder.camera_2] - Stopping recorder [2024-05-01 14:39:59] [DEBUG ] [viseron.states] - Setting state of binary_sensor.camera_2_recorder to state: off, attributes {'name': 'Kitchen Recorder', 'domain': 'binary_sensor', 'id': 2591, 'start_time': datetime.datetime(2024, 5, 1, 19, 39, 56, 446489, tzinfo=datetime.timezone.utc), 'start_timestamp': 1714592396.446489, 'end_time': datetime.datetime(2024, 5, 1, 19, 39, 59, 354779, tzinfo=datetime.timezone.utc), 'end_timestamp': 1714592399.354779, 'date': '2024-05-01', 'path': '/recordings/camera_2/2024-05-01/19:39:56.mp4', 'filename': '19:39:56.mp4', 'thumbnail_path': '/thumbnails/camera_2/2591.jpg', 'objects': []} [2024-05-01 14:39:59] [DEBUG ] [viseron.states] - Setting state of sensor.camera_2_operation_state to state: scanning_for_motion, attribute s {'name': 'Kitchen Operation State', 'domain': 'sensor'} [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.01414 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00921 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00637 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00551, message repeated 2 times [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00508 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00219 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00195 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00193 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00146 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00089 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0, message repeated 3 times [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0, message repeated 2 times [2024-05-01 14:39:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:00] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:00] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:00] [DEBUG ] [viseron.components.webserver.api.handlers] - Routing to CameraAPIHandler.get_camera(args=[], kwargs={'ca mera_identifier': 'camera_2'}, request_arguments={'failed': True}) [2024-05-01 14:40:00] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:00] [DEBUG ] [viseron.components.webserver.api.handlers] - Routing to CameraAPIHandler.get_snapshot(*args=[], kwargs={'camera_identifier': 'camera_2'}, request_arguments={'rand': 'apldb', 'width': 666, 'access_token': ****, 'height': None}) [2024-05-01 14:40:00] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:00] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:00] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:00] [DEBUG ] [viseron.domains.camera.fragmenter.camera_2] - Checking for new segments to fragment [2024-05-01 14:40:00] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:01] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:01] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:01] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:01] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:01] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00053 [2024-05-01 14:40:02] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.0008 [2024-05-01 14:40:02] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00215 [2024-05-01 14:40:02] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00116 [2024-05-01 14:40:02] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00089 [2024-05-01 14:40:02] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00036 [2024-05-01 14:40:03] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00036, message repeated 2 times [2024-05-01 14:40:03] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00036 [2024-05-01 14:40:03] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00036 [2024-05-01 14:40:03] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:04] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:04] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:04] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:04] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:04] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:05] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:05] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:05] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:05] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:05] [DEBUG ] [viseron.domains.camera.fragmenter.camera_2] - Checking for new segments to fragment [2024-05-01 14:40:05] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:06] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:06] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:06] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:06] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:06] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:07] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:07] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:07] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:07] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:07] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:08] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:08] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:08] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:08] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:08] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:09] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:09] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:09] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:09] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:09] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:10] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:10] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:10] [DEBUG ] [viseron.components.webserver.api.handlers] - Routing to CameraAPIHandler.get_snapshot(args=[], kwargs={' camera_identifier': 'camera_2'}, request_arguments={'rand': 'di7ud', 'width': 666, 'access_token': *****, 'height': None}) [2024-05-01 14:40:10] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:10] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:10] [DEBUG ] [viseron.domains.camera.fragmenter.camera_2] - Checking for new segments to fragment [2024-05-01 14:40:10] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:11] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:11] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0, message repeated 2 times [2024-05-01 14:40:11] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-01 14:40:11] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00044 [2024-05-01 14:40:12] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00059 [2024-05-01 14:40:12] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00059 [2024-05-01 14:40:12] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00059 [2024-05-01 14:40:12] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00036

The errors at [2024-05-01 14:39:50] [ERROR ] [viseron.watchdog.thread_watchdog] - Thread viseron.camera.camera_2 is dead, restarting - (Restarted camera to create a fresh batch of latest logs)

Hope this helps. Regards. Thanks

roflcoopter commented 2 months ago

Your raw_command does not output any segments from what i can see. How come you are using raw_command? Does it work if you try without it?

usaraj commented 2 months ago

No, camera stream does not work without the raw command. Do I need to add additional parameters to the ffmpeg comm,and?

roflcoopter commented 2 months ago

Do you get any errors with the default command?

usaraj commented 2 months ago

No errors. The cursor just keeps spinning on the screen. I changed the raw command as below and sending you the latest debug info:

The raw command used is:

raw_command: ffmpeg -hide_banner -loglevel error -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts -use_wallclock_as_timestamps 1 -vsync 0 -timeout 5000000 -c:v h264_cuvid -rtsp_transport tcp -i rtsp://:@192.168.1.168:554/h264.mp4 -f segment -segment_time 5 -reset_timestamps 1 -strftime 1 -c:v copy /tmp/viseron/segments/camera_2/%s.mp4 -vf fps=1.0 -f rawvideo -pix_fmt nv12 pipe:1

DEBUG LOG:

[2024-05-02 13:34:27] [DEBUG ] [viseron.states] - Setting state of binary_sensor.camera_2_motion_detected to state: on, attributes {'name': 'Kitchen Motion Detected', 'domain': 'binary_sensor'} [2024-05-02 13:34:27] [INFO ] [viseron.components.ffmpeg.recorder.camera_2] - Starting recorder [2024-05-02 13:34:27] [DEBUG ] [viseron.components.ffmpeg.recorder.camera_2] - Saving thumbnail in /thumbnails/camera_2 [2024-05-02 13:34:27] [DEBUG ] [viseron.components.storage.tier_handler.camera_2.tier_0] - File created: /thumbnails/camera_2/3220.jpg [2024-05-02 13:34:28] [DEBUG ] [viseron.states] - Setting state of binary_sensor.camera_2_recorder to state: on, attributes {'name': 'Kitchen Recorder', 'domain': 'binary_sensor', 'id': 3220, 'start_time': datetime.datetime(2024, 5, 2, 18, 34, 27, 843479, tzinfo=datetime.timezone.utc), 'start_timestamp': 1714674867.843479, 'end_time': None, 'end_timestamp': None, 'date': '2024-05-02', 'path': '/recordings/camera_2/2024-05-02/18:34:27.mp4', 'filename': '18:34:27.mp4', 'thumbnail_path': '/thumbnails/camera_2/3220.jpg', 'objects': []} [2024-05-02 13:34:28] [DEBUG ] [viseron.states] - Setting state of image.camera_2_latest_thumbnail to state: unknown, attributes {'name': 'Kitchen Latest Thumbnail', 'domain': 'image', 'start_time': '2024-05-02T18:34:27.843479+00:00', 'path': '/recordings/camera_2/2024-05-02/18:34:27.mp4', 'thumbnail_path': '/thumbnails/camera_2/3220.jpg'} [2024-05-02 13:34:28] [DEBUG ] [viseron.states] - Setting state of sensor.camera_2_operation_state to state: recording, attributes {'name': 'Kitchen Operation State', 'domain': 'sensor'} [2024-05-02 13:34:28] [DEBUG ] [viseron.components.webserver.api.handlers] - Routing to CameraAPIHandler.get_snapshot(*args=[], kwargs={'camera_identifier': 'camera_2'}, request_arguments={'rand': 'iqcf7k', 'width': 666, 'height': None, 'access_token': ****}) [2024-05-02 13:34:28] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.14724 [2024-05-02 13:34:28] [DEBUG ] [viseron.components.storage.tier_handler.camera_2.tier_0] - File modified (delayed event): /thumbnails/camera_2/3220.jpg [2024-05-02 13:34:29] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.14959 [2024-05-02 13:34:30] [DEBUG ] [viseron.domains.camera.fragmenter.camera_2] - Checking for new segments to fragment [2024-05-02 13:34:30] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.10501 [2024-05-02 13:34:31] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.05646 [2024-05-02 13:34:31] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Motion stopped [2024-05-02 13:34:31] [DEBUG ] [viseron.states] - Setting state of binary_sensor.camera_2_motion_detected to state: off, attributes {'name': 'Kitchen Motion Detected', 'domain': 'binary_sensor'} [2024-05-02 13:34:31] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 9 [2024-05-02 13:34:32] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.04877 [2024-05-02 13:34:32] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 8 [2024-05-02 13:34:33] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.02508 [2024-05-02 13:34:33] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 7 [2024-05-02 13:34:34] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.01579 [2024-05-02 13:34:34] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 6 [2024-05-02 13:34:35] [DEBUG ] [viseron.domains.camera.fragmenter.camera_2] - Checking for new segments to fragment [2024-05-02 13:34:35] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00071 [2024-05-02 13:34:35] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 5 [2024-05-02 13:34:36] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00113 [2024-05-02 13:34:36] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 4 [2024-05-02 13:34:37] [DEBUG ] [viseron.components.webserver.websocket_api] - Received {"type":"subscribe_event","event":"camera_2/recorder/start","command_id":26} [2024-05-02 13:34:37] [DEBUG ] [viseron.components.data_stream] - Subscribing to data topic event/camera_2/recorder/start, <function subscribe_event..forward_event at 0x7fddf3567670> [2024-05-02 13:34:37] [DEBUG ] [viseron.components.webserver.api.handlers] - Routing to RecordingsAPIHandler.get_recordings_camera(args=[], kwargs={'camera_identifier': 'camera_2'}, request_arguments={'latest': True, 'daily': True, 'failed': True}) [2024-05-02 13:34:37] [DEBUG ] [viseron.components.webserver.api.handlers] - Routing to CameraAPIHandler.get_camera(*args=[], kwargs={'camera_identifier': 'camera_2'}, request_arguments={'failed': True}) [2024-05-02 13:34:37] [DEBUG ] [viseron.components.webserver.websocket_api] - Received {"type":"subscribe_event","event":"camera_2/recorder/stop","command_id":27} [2024-05-02 13:34:37] [DEBUG ] [viseron.components.data_stream] - Subscribing to data topic event/camera_2/recorder/stop, <function subscribe_event..forward_event at 0x7fddf35a8ca0> [2024-05-02 13:34:37] [DEBUG ] [viseron.components.webserver.tiered_file_handler] - Searching for file /thumbnails/camera_2/3220.jpg [2024-05-02 13:34:37] [DEBUG ] [viseron.components.webserver.tiered_file_handler] - Searching for file /thumbnails/camera_2/2635.jpg [2024-05-02 13:34:37] [DEBUG ] [viseron.components.webserver.tiered_file_handler] - File /thumbnails/camera_2/3220.jpg exists, not searching tiers [2024-05-02 13:34:37] [DEBUG ] [viseron.components.webserver.tiered_file_handler] - File /thumbnails/camera_2/2635.jpg exists, not searching tiers [2024-05-02 13:34:37] [DEBUG ] [viseron.components.webserver.tiered_file_handler] - Searching for file /thumbnails/camera_2/2336.jpg [2024-05-02 13:34:37] [DEBUG ] [viseron.components.webserver.tiered_file_handler] - File /thumbnails/camera_2/2336.jpg exists, not searching tiers [2024-05-02 13:34:37] [DEBUG ] [viseron.components.webserver.tiered_file_handler] - Searching for file /thumbnails/camera_2/1958.jpg [2024-05-02 13:34:37] [DEBUG ] [viseron.components.webserver.tiered_file_handler] - File /thumbnails/camera_2/1958.jpg exists, not searching tiers [2024-05-02 13:34:37] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00132 [2024-05-02 13:34:37] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 3 [2024-05-02 13:34:38] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:38] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 2 [2024-05-02 13:34:38] [DEBUG ] [viseron.components.webserver.api.handlers] - Routing to HlsAPIHandler.get_recording_hls_playlist(*args=[], *kwargs={'camera_identifier': 'camera_2', 'recording_id': '3220'}, request_arguments={}) [2024-05-02 13:34:38] [ERROR ] [viseron.components.webserver.api.v1.hls] - Could not find init.mp4 file for camera camera_2 [2024-05-02 13:34:38] [WARNING ] [tornado.access] - 404 GET /api/v1/hls/camera_2/3220/index.m3u8 (64.135.196.78) 43.50ms [2024-05-02 13:34:39] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:39] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 1 [2024-05-02 13:34:40] [DEBUG ] [viseron.domains.camera.fragmenter.camera_2] - Checking for new segments to fragment [2024-05-02 13:34:40] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:40] [INFO ] [viseron.components.nvr.nvr.camera_2] - Stopping recording in: 0 [2024-05-02 13:34:40] [INFO ] [viseron.components.ffmpeg.recorder.camera_2] - Stopping recorder [2024-05-02 13:34:40] [DEBUG ] [viseron.states] - Setting state of binary_sensor.camera_2_recorder to state: off, attributes {'name': 'Kitchen Recorder', 'domain': 'binary_sensor', 'id': 3220, 'start_time': datetime.datetime(2024, 5, 2, 18, 34, 27, 843479, tzinfo=datetime.timezone.utc), 'start_timestamp': 1714674867.843479, 'end_time': datetime.datetime(2024, 5, 2, 18, 34, 40, 832465, tzinfo=datetime.timezone.utc), 'end_timestamp': 1714674880.832465, 'date': '2024-05-02', 'path': '/recordings/camera_2/2024-05-02/18:34:27.mp4', 'filename': '18:34:27.mp4', 'thumbnail_path': '/thumbnails/camera_2/3220.jpg', 'objects': []} [2024-05-02 13:34:40] [DEBUG ] [viseron.states] - Setting state of sensor.camera_2_operation_state to state: scanning_for_motion, attributes {'name': 'Kitchen Operation State', 'domain': 'sensor'} [2024-05-02 13:34:40] [DEBUG ] [viseron.components.webserver.api.handlers] - Routing to RecordingsAPIHandler.get_recordings_camera(args=[], kwargs={'camera_identifier': 'camera_2'}, request_arguments={'latest': True, 'daily': True, 'failed': True}) [2024-05-02 13:34:41] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:42] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:43] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:44] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:45] [DEBUG ] [viseron.domains.camera.fragmenter.camera_2] - Checking for new segments to fragment [2024-05-02 13:34:45] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:46] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.0008 [2024-05-02 13:34:47] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:48] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0.00089 [2024-05-02 13:34:49] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:50] [DEBUG ] [viseron.domains.camera.fragmenter.camera_2] - Checking for new segments to fragment [2024-05-02 13:34:50] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:51] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:52] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:53] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:54] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:55] [DEBUG ] [viseron.domains.camera.fragmenter.camera_2] - Checking for new segments to fragment [2024-05-02 13:34:55] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:56] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:57] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:58] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:34:59] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:35:00] [DEBUG ] [viseron.domains.camera.fragmenter.camera_2] - Checking for new segments to fragment [2024-05-02 13:35:00] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:35:01] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:35:02] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0 [2024-05-02 13:35:03] [DEBUG ] [viseron.components.mog2.motion_detector.camera_2] - Max motion area: 0

There are no files in the segment/camera folder There are no files in the recordings/camera folder There are no files in the tmp/viseron/camera folder

I am running docker as sudo. Does that impact anything? Is it a folder permissions issue? I tried to chmod the permissions to everyone, yet the problem persists.

usaraj commented 2 months ago

Update; After changing the ffmpeg raw command, files are being generated upon motion detection for the first time, Here is the print directory output:

root@37075a18c594:/segments/camera_2# drwxr-xr-x 7 root root 4096 Apr 26 12:09 .. -rw-r--r-- 1 root root 931 May 2 14:31 init.mp4 -rw-r--r-- 1 root root 429648 May 2 14:31 1714678317.m4s drwxr-xr-x 2 root root 4096 May 2 14:31 .

Here below is the web developer console url calll response output XHR GET http://000.000.000.000:8888/api/v1/hls/camera_2/3291/index.m3u8 [HTTP/1.1 200 OK 38ms] 1 #EXTM3U 2 #EXT-X-VERSION:6 3 #EXT-X-MEDIA-SEQUENCE:0 4 #EXT-X-INDEPENDENT-SEGMENTS 5 #EXT-X-MAP:URI="/files/segments/camera_2/init.mp4" 6 #EXT-X-ENDLIST

The problem is that the clip is not being displayed in the player. The screen just has a spinning wheel in the center of the video js player. There are no errors reported in the browser console. Not sure yet of browser / video js issue?

Yet, there no files in the /recordings folder.

Once this is resolved and recordings appear intend to integrate mjpeg camera and go from there. Thanks

roflcoopter commented 1 month ago

/recordings will only contain recordings if you use create_event_clip: true The frontend uses the files in /segments to play the HLS playlist.

Strange that it just keeps spinning. Can you show me the debug logs from Viseron startup and let it run for a minute or two?

jonadis commented 9 hours ago

Where would create_event_clip: true go in the configuration? I went through all the docs and can't find that mentioned. my /recordings is empty but all the clips are in /segments