To stream your MP4 video file to Owncast using FFmpeg
To stream your MP4 video file to Owncast using FFmpeg, follow these steps:
1. Locate Your Owncast RTMP Credentials
- In your Owncast admin dashboard (
http://your-server:8080/admin), go to Configuration → Stream Keys. - Copy the Stream URL (e.g.,
rtmp://your-server/live) and Stream Key (e.g.,abc123-secret-key).
2. Basic FFmpeg Command
fffmpeg -re -stream_loop -1 -i video.mp4 \
-map 0:v -map 0:a \
-c:v libx264 -preset veryfast -b:v 2500k -maxrate 2500k -bufsize 5000k -g 60 -pix_fmt yuv420p \
-c:a aac -b:a 128k -ar 44100 \
-f flv 'rtmp://localhost:1935/live/key'
Explanation of Flags:
-re: Read input at native frame rate (avoids streaming too fast).-stream_loop -1: Loop the video infinitely (remove this to stream once).-c:v libx264: Use H.264 video codec.-preset veryfast: Balances speed and compression efficiency.-b:v 2500k: Video bitrate
To stream your MP4 video file to Owncast using FFmpeg, follow these steps:
1. Locate Your Owncast RTMP Credentials
- In your Owncast admin dashboard (
http://your-server:8080/admin), go to Configuration → Stream Keys. - Copy the Stream URL (e.g.,
rtmp://your-server/live) and Stream Key (e.g.,abc123-secret-key).
2. Basic FFmpeg Command
fffmpeg -re -stream_loop -1 -i video.mp4 \
-map 0:v -map 0:a \
-c:v libx264 -preset veryfast -b:v 2500k -maxrate 2500k -bufsize 5000k -g 60 -pix_fmt yuv420p \
-c:a aac -b:a 128k -ar 44100 \
-f flv 'rtmp://localhost:1935/live/key'
Explanation of Flags:
-re: Read input at native frame rate (avoids streaming too fast).-stream_loop -1: Loop the video infinitely (remove this to stream once).-c:v libx264: Use H.264 video codec.-preset veryfast: Balances speed and compression efficiency.-b:v 2500k: Video bitrate
0 Comments
Comments 0
No comments yet. Be the first to comment!