-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Reolink: Clips gallery and timeline show no media #1870
Comments
Let me start with: This functionality is fairly new, I have only a single Reolink camera, and this is the first issue report I can ever recall on reolink media. As such, either it works perfectly for everyone else (extremely unlikely) or you're the guinea pig here running into the early issues. These kind of things may take a bit of iteration, so thank you in advance for your patience. Would it be possible for you to open the Media sidebar in HA, take a screenshot of what you see, drill down into "Reolink" (take a screenshot), then into resolutions (take a screenshot), then into a particular day (take a screenshot), until you reach rock bottom? That might save some iterations, as I can work through what the card might be seeing in your setup. I can already see at least one problem, the card is expecting media to be a timestamp followed by a duration, but your media items have another parameter, in this case "Person": Another potential issue, the card expects folders with days to be called (e.g.) |
Thank you for looking into this! Pleas find the screenshots below. I've configured the camera to only record events of the type "person" and "vehicle" to save space on the SD card. Maybe no labels are added if recording 24/7. In the last screenshot, there is also an event with both labels. In my case every recording has a label attached. I assume (have not tested it) that if I also enable recording in case of a pet detection, there would be a corresponding label. It would be great if you could add the label to the clips and/or even provide an option to filter for that. Regarding the formatting of the days, as far as I remember I did not configure anything to have this. A few month ago I had a second Reolink connected, maybe the Reolink integration adds this for clearness? |
@sherryxiao1988 No, if you have the same issue as the original poster, you need to wait for the issue to be fixed I'm afraid. I think I have what I need here, just didn't get around to it yet. |
@dermotduffy Thanks for the quick reply! Also thank you for making and maintaining such a wonderful repo! |
@sherryxiao1988 Looking again at your image (I had read your comment first via email), I don't think you should have this issue as your files should already work, since the labels are not present (e.g. there's no "Person" in your filenames, unlike the screenshots posted by the original filer). You may wish to file a new issue and we can discuss it specifically there, as the fix for this one looks unlikely to help you. |
@dermotduffy Created the issue here: #1899 Thank you! |
@dermotduffy Thank you, I just found some time to test it and it is working great for me! Two things came up to my mind:
Like pointed out here, it seems like the Reolink integration is not able to provide these due to lacking support of Reolink's API. However, I already do the following:
I use this image as a notification thumbnail when sending a notification to my android phone. I've seen that there are plans for a general HA media folder integration, however I feel unsure about if that would bring thumbnails to the Reolink clips. cheers, Thorsten |
It's works, a miracle!
I looked into this. The issue is that fetching from Reolink cameras is slow. The only way to know the filter "options" would be to recurse the entire camera looking for these tags, as there's no way I know of to simply ask "Tell me the tags you know about". This would be incredibly slow. This leaves two options:
Thoughts?
It would not. That feature is all about exposing your existing HA media folders to the card. If they already have thumbnails, it would work. In this case, if I'm reading it right, you also have no way of associating the saved image with the media, so this would not work for you. That proposal also does not allow filtering of any kind, e.g. it's only "manual browsing", so the tagging above wouldn't help you, at least not in the first versions. Maybe there's some heuristic that could be applied here, e.g. if a non-image media is found in a folder with name X, and there's an image media in the same folder, with the same name (but ending in an image extension), use that as the thumbnail. Something like this might be possible as a later revision on the "folder" proposal you link to. I think this is also what @barbierp35 was looking for. Could something like this work for you? I'll warn you that development on this card is slow, so this would be some indeterminate amount of time down the line... |
I had no doubts :)
Both options would be ok for me. If we go with the second approach, any changes to the labels (e.g due to a camera firmware update) would not break anything. Regarding the thumbnails, am I right in my understanding that you rely on the thumbnails provided by the HA media source? If you have control over the thumbnail being displayed for each clip, these could simply be loaded from a folder using the heuristic you've described. I was also thinking about if it would be possible to "inject" my own thumbnails into the media source provided by the HA Reolink integration. Do you know if this is feasible? |
For information, in media folder where I put my reolink records with FTP, many times there is a little difference in file name between video and image. Exemple : @ecdlguy For your idea to take a screen when there is a person détection, how can you link this screen with the video media ? |
@barbierp35 I try to summarize what I've done in order to send notifications to my mobile containing a thumbnail of the detected person: image_processing:
- platform: doods
scan_interval: 1576800000 # 50 years
url: "http://192.168.6.10:8091" # Doods container webinterface
detector: pytorch # Much better ootb detection quality than tensorflow
file_out:
- "/config/www/doods_latest.jpg"
labels:
- name: person
confidence: 20
source:
- entity_id: camera.cx410_schnappschusse_klar The source entity is the camera stream "Snapshots Clear" (disabled by default), see here. The alias: Run doods if person detected
description: ""
mode: single
triggers:
- type: turned_on
device_id: f23dbdab3d397d09ce36c1594464374a
entity_id: 4287d11d205ab68c95c1bc075ca8b3ca
domain: binary_sensor
trigger: device
conditions: []
actions:
- data: {}
target:
entity_id: image_processing.doods_cx410_schnappschusse_klar
action: image_processing.scan
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0 This automation is executed if a person is detected using the corresponding binary sensor of the HA Reolink Integration. The 5 s delay along with the The next step is to react upon a successful detection of a person: alias: Crop, Resize and send Doods Snapshot
description: ""
mode: single
triggers:
- entity_id:
- image_processing.doods_cx410_schnappschusse_klar
trigger: state
conditions: []
actions:
- if:
- condition: numeric_state
entity_id: image_processing.doods_cx410_schnappschusse_klar
attribute: total_matches
above: 0
then:
- data:
a: "{{ trigger.to_state.attributes.matches.person.0.box.0 }}"
b: "{{ trigger.to_state.attributes.matches.person.0.box.1 }}"
c: "{{ trigger.to_state.attributes.matches.person.0.box.2 }}"
d: "{{ trigger.to_state.attributes.matches.person.0.box.3 }}"
i: "1"
action: shell_command.crop_doods_image_params
- data:
i: "1"
action: shell_command.fit_doods_image
- data:
message: Kamera Garage hat um {{now()}} eine Person erkannt!
title: Kamera Alarm
data:
ttl: 0
priority: high
visibility: public
image: /local/doods_fit_1.jpg
clickAction: >-
intent://scan/#Intent;launchFlags=0x14000000;component=com.mcu.reolink/com.android.bc.login.WelcomeActivity;S.UID=95270005TJ8O109W;S.ALMTIME={{now().isoformat()}};S.ALMNAME=Detection;S.DEVNAME=CX410;S.ALMTYPE=PEOPLE;S.ALMCHN=1;end
action: notify.mobile_app_pixel_7a
else:
- data:
message: Person erkannt!
title: Kamera Alarm
data:
ttl: 0
priority: high
visibility: public
image: /api/camera_proxy/camera.cx410_snapshots_main
clickAction: >-
intent://scan/#Intent;launchFlags=0x14000000;component=com.mcu.reolink/com.android.bc.login.WelcomeActivity;S.UID=95270005TJ8O109W;S.ALMTIME={{now().isoformat()}};S.ALMNAME=Detection;S.DEVNAME=CX410;S.ALMTYPE=PEOPLE;S.ALMCHN=1;end
action: notify.mobile_app_pixel_7a Here, we check if doods found at least one match (at least one person). If this is the case, a shell command is executed. This command is defined in the configuration.yaml: ffmpeg:
shell_command:
crop_doods_image_params: 'ffmpeg -i /config/www/doods_latest.jpg -y -vf "crop=iw*({{ d }}-{{ b }})-2:ih*({{ c }}-{{ a }})-2:iw*{{ b }}+2:ih*{{ a }}+2" /config/www/doods_crop_{{ i }}.jpg' The shell commands defined above uses FFmpeg which also allows image processing. Another shell script is used in order to create a thumbnail with a fixed size without distorting the cropped snapshot: fit_doods_image: 'ffmpeg -i /config/www/doods_crop_{{ i }}.jpg -y -vf scale=1024:512:force_original_aspect_ratio=decrease,pad=1024:512:-1:-1:color=black" /config/www/doods_fit_{{ i }}.jpg' This is important for sending it as a notification thumbnail. The intent used for the notification's click action is defined such that clicking the notification directly opens the Reolink App and plays the stream for the given timestamp. Btw I'd love to change that to an intent wich opens the HA companion app, and plays the corresponding clip within the advanced-camera-card... Do you know if this is possible? Using e.g. a timestamp? |
[Sorry lots to reply to here]
That's almost certainly a bug. Opened a separate issue. Reolink won't support seeking, so this message should never show up.
Correct. This is the default behavior.
They could, although the further away we put the thumbnails, the more complex the "mapping" that's required here. A much (much) better solution is just for Reolink integration and the Reolink API to support thumbnails, it's just that that may never happen.
Everything is possible, of course. But this is not currently supported by Home Assistant, and I seriously doubt it ever will be.
Home Assistant gives each piece of media a unique ID, the camera card knows this ID. If we had something like this it might be possible to use that ID, but I'm not sure whether or not that URL would be opened in the companion app. So ... maybe? :-) |
Even if the thumbnails were supplied by the Reolink integration, I still could not use my own "cropped to the object" thumbnails... It's really helpful to have a close-up of the object because on small screens it's hard to identify a person if the whole video image is used as a thumbnail.
I not sure if I could use the ID or how to obtain it. My notifications are send if the Reolink camera integration receives a "person detected" push from the camera, and I only know the time of the detection, no ID. If I pass a timestamp to the camera card and it would simply play / jump to the closest (timewise) clip, this would be great. |
You may wish to open this as a separate feature request as I don't think it's really related to this one, or the Folder idea. For now, I think this original issue can be closed. |
Checklist:
[REQUIRED] Card diagnostic information:
[REQUIRED] Description of problem:
Clips gallery says "Waiting for media to load..." and finally "No media to display".
However, in HA under "Media Sources" I can see the Reolink Integration with the camera listed.
When clicking on it, there are two folders, "Low resolution" and "High resolution".
Both contain folders for each day and each day has subfolders for every event containing the recorded clip stored on the SD card of the camera. I can play them fine directly out of HA.
I don't know how to debug further, please advice / guide me.
cheers, Thorsten
Edit: Here is some logging information from the browser console:
It's just a snippet, I've left out older days. I've attached the json of the last response.
log.txt
The text was updated successfully, but these errors were encountered: