This workflow allows you to receive a snapshot from an IP camera using the RTSP protocol via Telegram.
When a Telegram user sends an RTSP URL to your bot, n8n uses FFmpeg to connect to the IP camera, takes a single frame, and sends it back as a photo message.
- Accepts RTSP URLs from Telegram messages
- Captures one snapshot from the video stream using FFmpeg
- Sends the captured image back to the same chat
- Validates input to avoid incorrect URLs
- Handles timeouts and errors gracefully
Before using this workflow, make sure your system meets the following requirements:
On Ubuntu / Debian:
sudo apt update
sudo apt install ffmpegYou can use:
-
n8n Cloud, or
-
a self-hosted version (
npm,Docker, orDesktop)
-
Talk to @BotFather in Telegram.
-
Create a new bot and get your Bot Token.
-
In n8n, go to Credentials → Telegram API, and add your token there.
-
Assign this credential to all Telegram nodes in this workflow after importing.
-
Import the JSON workflow into n8n:
-
Click “+ New workflow” → “Import from file”
-
Select
IP Camera Snapshot Bot.json
-
-
Open the Telegram nodes and select your created Telegram API credentials.
-
Activate the workflow.
-
In Telegram, send a message with a valid RTSP URL, e.g.:
rtsp://username:password@192.168.1.10:554/stream -
The bot will take a snapshot and reply with the image.
| Node | Description |
|---|---|
| Telegram Trigger | Waits for messages from your bot. |
| Edit Fields | Extracts the text (RTSP URL) from the Telegram message. |
| Check URL | Validates that the message starts with rtsp://. |
| Get Snapshot (ffmpeg) | Executes FFmpeg to capture one frame from the stream. |
| Open Image | Reads the generated file /tmp/frame.jpg. |
| Send Photo | Sends the image back to the Telegram chat. |
| Error Nodes | Send messages if the URL is invalid or snapshot fails. |
-
This workflow saves snapshots temporarily in
/tmp/frame.jpg. -
If you need persistent storage, change the path to your preferred directory.
-
Ensure that the n8n host has access to the RTSP source and that ports are open.