Quality loss with delayed camera snapshots

Dear all,

I’m using automations with camera snapshots of IP cameras (all upCam Vortex) for mail notifications if for example someone rings at the door or the garage door is open for a specific time period.
In case of the door bell, the snapshot is taken immediately ans everything is fine. In case of the garage door, the snapshot is taken with a delay of 10 minutes when the door is still open.
Curious for me: The longer the delay period, the more the image quality is suffering. When im starting the same automation for the garage door by hand, image quality is in 100% of the cases perfect.
Here some examples:

When I’m using this automation:

- id: alarm_fahrradgarage
  alias: Alarm Fahrradgarage
  trigger:
  - platform: state
    entity_id: binary_sensor.fahrradgarage
    to: 'on'
    for: 00:10:00
  condition: []
  action:
  - service: camera.snapshot
    data:
      entity_id: camera.garage
      filename: /media/garage.jpg
  - service: notify.garage
    data:
      title: 'Alarm: Fahrradgarage'
      message: Die Fahrradgarage steht seit 10 Minuten auf
      target:
      - [email protected]
      data:
        images:
        - /media/garage.jpg

This is the outcome:

When I’m starting the same automation by hand and not triggered by the magnetic sensor mounted to the garage door this is the outcome:

And when I’m reducing the delay it decreases the quality loss.

- id: alarm_fahrradgarage
  alias: Alarm Fahrradgarage
  trigger:
  - platform: state
    entity_id: binary_sensor.fahrradgarage
    to: 'on'
    for: 00:02:00
  condition: []
  action:
  - service: camera.snapshot
    data:
      entity_id: camera.garage
      filename: /media/garage.jpg
  - service: notify.garage
    data:
      title: 'Alarm: Fahrradgarage'
      message: Die Fahrradgarage steht seit 2 Minuten auf
      target:
      - [email protected]
      data:
        images:
        - /media/garage.jpg

This, if triggered by the garage door after 2 mins, results in:

With the other, identical, cameras I’m not using a delay (door bells) and there is no issue.

Any idea how to solve this?

Thanks a lot in advance guys and all the best
Benedikt

No idea anyone?
Would highly appreciate any help.
Thanks a lot in advance!

What camera integration are you using to get the cameras into HA?
What happens if you try multiple snapshots in a row manually? Not a single one does that?
What encoding does the camera use?
Doesn’t make any sense because the “delay” you are using in waiting for a state to change for X time should have no bearing on the snapshot service… can you make another automation using that state change and an actual “delay:” line… just for curiosities sake.

I’m using MotionEye. Multiple manual starts of the automation result in 100% perfect snapshots.
Will try the suggestion with another automation for testing…
I really have no idea…