Android app [RTSP Camera Server] as camera

On the lookout to send videos from my front door camera via telegram I came upon the RTSP protocol.
(so for example this or that or here )
Google search got me this Android app called RTSP Camera Server.
I already overread that I could add the rtsp stram to Home assistant, (instead of Android
IP Webcam
wich I use now)

Unluckaly I failed so far.
But maybe join me on the adventure!


camera:
  - platform: ffmpeg
    name: front_door_rtsp
    input: -rtsp_transport tcp -i rtsp://10.0.0.201:5554/camera?res=640x480&fps=10&mic=off

Tryed this for example
the “documentation” says

 command URL:
Active camera - rtsp://(device ip address):5554/camera 
Back camera - rtsp://(device ip address):5554/back
Front camera - rtsp://(device ip address):5554/front

Camera URL Parameters:
res Resolution - width(number)xheight(number)
fps Frame per second - fps(number)
mic Enable/Disable microphone - on(string) or off(string) 
Example: rtsp://(device ip address):5554/back?res=640x480&fps=10&mic=on

also Tryed it via command line, Bud didnt understood it for now.
pi@hassbian:~ $ ffmpeg -rtsp_transport tcp rtsp:///10.0.0.201:5554/camera?res=640x480&fps=10 streamprofile=Recording -vcodec copy -v debug -t 1 test.mp4
Its starting to stream? but never finishes or creating a output.

Edit:
Works now

I just use ffmpeg and Android IP cam - Bou would also work with the stsp stream

shell_command:

  snapv40: ffmpeg -y -i http://USER:[email protected]:8080/video?profile=0 -t 4 -b:v 2048k -vcodec libx264 -fs 2048k {{filename}}
# -t time in secconds 
# -b:v videobitrate of output video in kilobytes (you have to try)
# -vcodec videocodec (use ffmpeg -codecs to list all available codecs)
# -fs filesize 

script:
  telegram_video_v40:
    sequence:
      - service: shell_command.snapv40
        data:
            filename: /tmp/ffmpg.mp4
      - delay:
          seconds: 75
      - service: telegram_bot.send_video
        data:
          file: "/tmp/ffmpg.mp4"

When you get a black picture then the encoding wasnt finished .
set up the delay a little higher