FFmpeg components and same stream

I have one IP camera and want to integrate it into HA as a camera FFmpeg and FFmpeg motion sensor. This results in HA that it’s using 2 streams at the same time.

Additionally I have create a small script, still perfecting, to start and stop recording from that same stream. using a switch component.

This results in the use of 3 streams if everything is up and running. Is there a way to reduce it to 1 stream, to reduce the bandwidth?

My camera is a DAHUA DH-IPC-HDBW4431R-ZS. I’m using the rstp protocol.

Any suggestions to my problem is welcome.

have you learned anything new on this topic? would love to learn as well.

No I haven’t learned anything new. I know use zoneminder instead, with a custom php script that monitors the DB and publish zone activity to a MQTT.