Created
June 7, 2021 03:41
-
-
Save compulim/d17e58ca4399129ded7690c495266016 to your computer and use it in GitHub Desktop.
RTMP server to show live stream and dump it to disk
This file contains 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/sh | |
# This script will act as a RTMP server and archive your RTMP live stream as-is without transcoding. | |
# Prerequisites: ffmpeg. | |
# Configure your RTMP source to stream to rtmp://your-ip-address:5555/. | |
ffmpeg -listen 1 -i rtmp://0.0.0.0:5555 -c copy -c:v copy -c:a copy your-video.m4v |
This file contains 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/sh | |
# This script will act as a RTMP server, receive your RTMP live stream, and show it locally via ffplay. | |
# Prerequisites: ffmpeg and Node.js. | |
# Configure your RTMP source to stream to rtmp://your-ip-address:5555/. | |
while true | |
do | |
npx concurrently --kill-others "ffmpeg -listen 1 -i rtmp://0.0.0.0:5555 -c copy -f rtsp -rtsp_transport tcp rtsp://127.0.0.1:1234/live.sdp" "ffplay -fs -rtsp_flags listen rtsp://127.0.0.1:1234/live.sdp?tcp" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment