Created
November 20, 2024 16:33
-
-
Save fpaupier/59b057d289829d8168ff9a41e8806df7 to your computer and use it in GitHub Desktop.
Stream a mp4 video (requires mediamtx)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| VIDEO_SOURCE="video.mp4" | |
| RTSP_URL="rtsp://machine-ip:8554/stream" | |
| ffmpeg \ | |
| -stream_loop -1 \ | |
| -re \ | |
| -i "$VIDEO_SOURCE" \ | |
| -c:v libx264 \ | |
| -preset ultrafast \ | |
| -tune zerolatency \ | |
| -c:a aac \ | |
| -f rtsp \ | |
| -rtsp_transport tcp \ | |
| "$RTSP_URL" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Before, make sure to install mediaMTX
# Install MediaMTX - update version to select appropriate ARM / AMD arch wget https://github.com/bluenviron/mediamtx/releases/download/v1.10.0/mediamtx_v1.10.0_linux_armv7.tar.gz tar -xzvf mediamtx_v1.10.0_linux_armv7.tar.gz. ./mediamtx