8ff / firescrew

Firescrew - Spotting moving objects on your RTSP network cameras faster than a caffeinated cat!
https://firescrew.com
GNU Affero General Public License v3.0
142 stars 11 forks source link

No HI res streams found at rtsp://... #2

Closed wehbs closed 1 year ago

wehbs commented 1 year ago

Version: 2023-08-17_02:50:01

Docker Command: docker run --rm -v /Volumes/Data/firescrew/media:/media -v /Volumes/Data/firescrew/config.json:/config.json -it 8fforg/firescrew:latest /config.json

Error: No HI res streams found at rtsp://username:password@192.168.0.53:554/h264Preview_01_main

Config: { "cameraName": "Driveway", "deviceUrl": "rtsp://username:password@192.168.0.53:554/h264Preview_01_sub", "hiResDeviceUrl": "rtsp://username:password@192.168.0.53:554/h264Preview_01_main", "printDebug": true, "video": { "hiResPath": "Data/firescrew/rec/hi", "recodeTsToMp4": false }, "motion": { "confidenceMinThreshold": 0.3, "lookForClasses": ["car", "truck", "person", "bicycle", "motorcycle", "bus", "cat", "dog", "boat"], "embeddedObjectScript": "objectDetectServerYolo.py", "networkObjectDetectServer": "", "prebufferSeconds": 10, "eventGap": 30 }, "pixelMotionAreaThreshold": 50.00, "objectCenterMovementThreshold": 50.0, "objectAreaThreshold": 500.0, "streamDrawIgnoredAreas": true, "enableOutputStream": true, "outputStreamAddr": ":8040", "events": { "webhookUrl": "", "scriptPath": "", "slack": { "url": "" }, "mqtt": { "host": "", "port": 0, "user": "", "password": "", "topic": "" } } }

I did confirm via VLC that the url to the stream is functional. Any thoughts on what I need to change on my end?

chiefMarlin commented 1 year ago

For some reason ffprobe is unable to find valid streams at the url provided, this is the command that is ran to fetch the streams. Can you please run this, it should give some clues (make sure to correct username:password)

docker run --rm -it --entrypoint /bin/bash 8fforg/firescrew:latest -c "ffprobe -rtsp_transport tcp -v quiet -print_format json -show_streams rtsp://username:password@192.168.0.53:554/h264Preview_01_main"

If you have ffprobe locally, you can run it without docker:

ffprobe -rtsp_transport tcp -v quiet -print_format json -show_streams rtsp://username:password@192.168.0.53:554/h264Preview_01_main

Additionally, please try with the latest docker image, by running

docker pull 8fforg/firescrew:latest
wehbs commented 1 year ago

Version: 2023-08-17_15:07:34

{ "streams": [ { "index": 0, "codec_name": "h264", "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", "profile": "High", "codec_type": "video", "codec_tag_string": "[0][0][0][0]", "codec_tag": "0x0000", "width": 2560, "height": 1440, "coded_width": 2560, "coded_height": 1440, "closed_captions": 0, "film_grain": 0, "has_b_frames": 0, "pix_fmt": "yuv420p", "level": 51, "field_order": "progressive", "refs": 1, "is_avc": "false", "nal_length_size": "0", "r_frame_rate": "299/12", "avg_frame_rate": "0/0", "time_base": "1/90000", "start_pts": 3607, "start_time": "0.040078", "bits_per_raw_sample": "8", "extradata_size": 24, "disposition": { "default": 0, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 } }, { "index": 1, "codec_name": "aac", "codec_long_name": "AAC (Advanced Audio Coding)", "profile": "LC", "codec_type": "audio", "codec_tag_string": "[0][0][0][0]", "codec_tag": "0x0000", "sample_fmt": "fltp", "sample_rate": "16000", "channels": 1, "channel_layout": "mono", "bits_per_sample": 0, "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/16000", "start_pts": 0, "start_time": "0.000000", "extradata_size": 2, "disposition": { "default": 0, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 } } ] }

So above is the response I received with the latest version. I still receive the same error however when attempting to start up.

Worth noting this stream is not directly from the camera but rather a restream. The original camera RTSP URL returns an empty json on the above command.

This was also ran through Docker.

chiefMarlin commented 1 year ago

Thanks for the info, i believe i found the issue, ffprobe with your stream provided values as 299/12 - 25fps rather than 25/1. This is fixed in the release i just pushed. If you have a docker image that was build today you should even have to pull a new one as it should already fetch the latest binary from github release, you would see message:

[+] Checking for updates...
Updated!
wehbs commented 1 year ago

Ok great! That allows me to launch everything now. However, I have a new issue:

16:29:32 [INFO] Event: objects_detected 16:29:32 [INFO] TRIGGERED NEW OBJECT @ {213 69}|8911.000000 [truck|0.318208] 2023/08/17 16:29:32 open Data/firescrew/rec/hi/clip_4x7fzul585GrPvj.ts: no such file or directory

Data/firescrew/rec/hi/ --> This directory DOES exist but not that .ts file. Something on my end? Also, if I should make a new issue for this just let me know, I am happy to. Thanks!

chiefMarlin commented 1 year ago

Thats great, it may be having issue with the relative path, i will add debugging and some checks in code for this shortly, In the meantime, are you able to provide docker command that you use for this ? (if using docker)

wehbs commented 1 year ago

Yes! Pasted below:

docker run --rm -v /Volumes/Data/firescrew/media:/media -v /Volumes/Data/firescrew/config.json:/config.json -it 8fforg/firescrew:latest /config.json

chiefMarlin commented 1 year ago

In this case you need to change your "hiResPath": "Data/firescrew/rec/hi", to use /media path like so "hiResPath": "/media", docker -v command syntax is -v src:dst

chiefMarlin commented 1 year ago

Earlier you mentioned that your camera does not provide any info when ffprobe is used, for this i have added bypass parameters, which make it possible to set these values manually

        "loStreamParamBypass": { // With some cameras ffprobe may not return the correct resolution, you can use this to bypass it
        "width": 0,
        "height": 0,
        "fps": 0
    },
    "hiResDeviceUrl": "", // URL of the high resolution video feed.
        "hiStreamParamBypass": { // With some cameras ffprobe may not return the correct resolution, you can use this to bypass it
        "width": 0,
        "height": 0,
        "fps": 0
    },

Latest build contains the updated config file and readme also reflects this now. If you dont mind giving it a try and let me know if it works for you. Also if you could provide the Model/Make of camera that would be useful.

Thanks

wehbs commented 1 year ago

Ok, that worked. I can now use the stream from the camera directly and object detection is working. The camera I am testing with is the Reolink RLC-820a. I have the camera set to 2k at the moment which uses H264.

Going to test it at 4k with H265 and will report back. Thanks again. As I test I will submit bugs and feedback/feature requests.

chiefMarlin commented 1 year ago

Thanks again, remember to grab latest releases often. I just pushed a new release that includes fixes to both models and performance improvements. It also prints inference speeds