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

[Support]: API bugs #6431

Closed
skrashevich opened this issue May 8, 2023 · 9 comments
Closed

[Support]: API bugs #6431

skrashevich opened this issue May 8, 2023 · 9 comments

Comments

@skrashevich
Copy link
Contributor

skrashevich commented May 8, 2023

Describe the problem you are having

I received an MQTT event with the following content:

{
    "before": {
        "id": "1683526465.197185-e91hv2",
        "camera": "kitchen",
        "frame_time": 1683527818.17968,
        "snapshot": {
            "frame_time": 1683526468.342398,
            "box": [
                456,
                806,
                711,
                1078
            ],
            "area": 69360,
            "region": [
                381,
                676,
                785,
                1080
            ],
            "score": 0.87109375
        },
        "label": "bottle",
        "sub_label": null,
        "top_score": 0.88720703125,
        "false_positive": false,
        "start_time": 1683526465.197185,
        "end_time": null,
        "score": 0.88720703125,
        "box": [
            458,
            806,
            710,
            1078
        ],
        "area": 68544,
        "ratio": 0.9264705882352942,
        "region": [
            396,
            704,
            772,
            1080
        ],
        "stationary": true,
        "motionless_count": 13339,
        "position_changes": 1,
        "current_zones": [],
        "entered_zones": [],
        "has_clip": true,
        "has_snapshot": true
    },
    "after": {
        "id": "1683526465.197185-e91hv2",
        "camera": "kitchen",
        "frame_time": 1683527878.332771,
        "snapshot": {
            "frame_time": 1683526468.342398,
            "box": [
                456,
                806,
                711,
                1078
            ],
            "area": 69360,
            "region": [
                381,
                676,
                785,
                1080
            ],
            "score": 0.87109375
        },
        "label": "bottle",
        "sub_label": null,
        "top_score": 0.88720703125,
        "false_positive": false,
        "start_time": 1683526465.197185,
        "end_time": null,
        "score": 0.88720703125,
        "box": [
            458,
            806,
            710,
            1078
        ],
        "area": 68544,
        "ratio": 0.9264705882352942,
        "region": [
            396,
            704,
            772,
            1080
        ],
        "stationary": true,
        "motionless_count": 13941,
        "position_changes": 1,
        "current_zones": [],
        "entered_zones": [],
        "has_clip": true,
        "has_snapshot": true
    },
    "type": "update"
}

I see that the has_clip field is true. This means I can get the video of this event.
I take the after.snapshot.frame_time field (1683526468.342398), as well as before.start_time (1683526465.197185) and try to get the video between these timestamps through the API. Just in case, I add 5 seconds on both sides.
I form a request to the API: curl http://localhost:5001/kitchen/recordings?before=1683526460&after=1683526468
I get the response: []
What I'm doing wrong?

Version

latest dev

Frigate config file

record:
  enabled: True
  expire_interval: 60
  retain:
    days: 10
    mode: motion
  events:
    pre_capture: 30
    post_capture: 120
    retain:
      default: 7
      mode: motion
      objects:
        person: 180
        bottle: 1
        car: 7

snapshots:
  enabled: True
  height: 1080

Relevant log output

2023-05-08 09:54:12.133335604  x.x.x.x - - [08/May/2023:09:54:12 +0300] "GET /api/kitchen/recordings?before=1683526460&after=1683526468 HTTP/1.1" 200 3 "-" "curl/7.87.0" "-"

FFprobe output from your camera

unrelevant

Frigate stats

No response

Operating system

Other Linux

Install method

HassOS Addon

Coral version

USB

Network connection

Wired

Camera make and model

camera-independent-issue

Any other information that may be helpful

No response

@NickM-27
Copy link
Collaborator

NickM-27 commented May 8, 2023

has_clip simply means that the camera currently has recording enabled, it's not an indication that the clip is ready. The segment hasn't finished processing from cache most likely.

#2128 is a related feature request

@skrashevich
Copy link
Contributor Author

My task is obtain a video clip of the minimum possible length (but not less then -5:+5) within the range of -5:+5 seconds concerning the moment of event detection. Do you have any suggestions regarding a workaround?

@NickM-27
Copy link
Collaborator

NickM-27 commented May 8, 2023

you'll need to give it some delay between when the message comes through and your request to get the recording

@skrashevich
Copy link
Contributor Author

you'll need to give it some delay between when the message comes through and your request to get the recording

I had hoped that the presence of the attribute "has_clip" means the existence of the record, rather than its potential availability 🙁

@NickM-27
Copy link
Collaborator

NickM-27 commented May 8, 2023

I had hoped that the presence of the attribute "has_clip" means the existence of the record, rather than its potential availability 🙁

Right, but it doesn't, which is the reason for the pinned feature request I linked above

@skrashevich
Copy link
Contributor Author

Right, but it doesn't, which is the reason for the pinned feature request I linked above

Do you have any plans to make significant changes to the recording manager subsystem (#6248) in the near future? I have some ideas on how to resolve these issues and implement flexible recording storage settings, but I would prefer not to do parallel useless work.

@NickM-27
Copy link
Collaborator

NickM-27 commented May 8, 2023

@blakeblackshear would be better to answer that question

@blakeblackshear
Copy link
Owner

There aren't any additional plans to overhaul the recordings in the next release beyond what has already been merged into dev. I would definitely suggest outlining your ideas ahead of time in case I think they are problematic long term.

@github-actions
Copy link

github-actions bot commented Jun 8, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jun 8, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants