Skip to content

Instantly share code, notes, and snippets.

@nunofgs
Last active January 3, 2026 20:36
Show Gist options
  • Select an option

  • Save nunofgs/84861ee453254823be6b069ebbce9ad2 to your computer and use it in GitHub Desktop.

Select an option

Save nunofgs/84861ee453254823be6b069ebbce9ad2 to your computer and use it in GitHub Desktop.
Use any RTSP camera with Prusa Connect

I use a cheap Tapo C100 webcam to monitor my 3D prints. It supports RTSP.

Screenshot 2023-07-17 at 23 26 34

Instructions

  1. Go to the Cameras section at https://connect.prusa3d.com
  2. Add a new camera.
  3. Click the QR code link
  4. Click "Start Camera"
  5. Open your browser's inspector window and look for the "/snapshot" request.
  6. Copy the "Fingerprint" and "Token" headers into the docker-compose below.

The end result!

Screenshot 2023-07-17 at 23 13 10

prusa-camera:
image: linuxserver/ffmpeg
restart: always
entrypoint: /bin/bash
command: /upload.sh
environment:
RTSP_URL: "rtsp://<username>:<password>@<camera.ip.address>/stream1"
FINGERPRINT: "<fingerprint-from-prusa-connect>"
TOKEN: "<token-from-prusa-connect-link>"
volumes:
- ./upload.sh:/upload.sh
#!/bin/bash
# Set default values for environment variables
: "${HTTP_URL:=https://webcam.connect.prusa3d.com/c/snapshot}"
: "${DELAY_SECONDS:=10}"
: "${LONG_DELAY_SECONDS:=60}"
while true; do
# Grab a frame from the RTSP stream using FFmpeg (timeout at 5s)
ffmpeg \
-timeout 5000000 \
-loglevel quiet \
-stats \
-y \
-rtsp_transport tcp \
-i "$RTSP_URL" \
-f image2 \
-vframes 1 \
-pix_fmt yuvj420p \
output.jpg
# If no error, upload it.
if [ $? -eq 0 ]; then
# POST the image to the HTTP URL using curl
curl -X PUT "$HTTP_URL" \
-H "accept: */*" \
-H "content-type: image/jpg" \
-H "fingerprint: $FINGERPRINT" \
-H "token: $TOKEN" \
--data-binary "@output.jpg" \
--no-progress-meter \
--compressed
# Reset delay to the normal value
DELAY=$DELAY_SECONDS
else
echo "FFmpeg returned an error. Retrying after ${LONG_DELAY_SECONDS}s..."
# Set delay to the longer value
DELAY=$LONG_DELAY_SECONDS
fi
sleep "$DELAY"
done
@pwelker
Copy link

pwelker commented Jan 3, 2026

Ich bekomme ständig die Fehlermeldung "Invalid Fingerprint" ist das Problem bekannt, was mache ich falsch?

Same here. Using jtee3d's solution, I have the following logs in docker and no image in prusa connect.

Input variables:
Camera 1, URL: rtsp://XXXX:YYYYY@192.168.178.141:554//h264Preview_01_main, Token
Processing camera: 1
Camera 1, URL: rtsp://XXXX:YYYYY@192.168.178.141:554//h264Preview_01_main, Token
Token: Token
Fingerprint: camera0000000001
'------
{"detail":"Invalid fingerprint"}Processing camera: 1
Camera 1, URL: rtsp://XXXX:YYYYY@192.168.178.141:554//h264Preview_01_main, Token
Token: Token
Fingerprint: camera0000000001

Please note: The rtsp link works when testing with VLC

Any idea?

EDIT: It worked when adding the right fingerprint values. Hence I recommend adding a third array in the yaml file for the fingerprints ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment