I want to broadcast a video file via FFmpeg, but I get this error:
Only one stream supported in the RTP muxer
I get that error when I write this:
ffmpeg.exe -i SomeVideo.mp4 -f rtp rtp://127.0.0.1:11111
I don't know what's wrong.
Your ffmpeg command creates two streams, one for video, one for audio. Do this instead:
ffmpeg -re -i SomeVideo.mp4 -vcodec copy -an -f rtp rtp://127.0.0.1:11111 -vn -acodec copy -f rtp rtp://127.0.0.1:11112
Port 11111
then has video without audio (-an
).
Port 11112
then has audio without video (-vn
).
Read each stream with, e.g., ffplay rtp://127.0.0.1:11112
.
(Part of this comes from advice at http://lucabe72.blogspot.com/2010/04/rtp-streaming-with-ffmpeg.html .)
The command should be
ffmpeg -re -i SomeVideo.mp4 -vcodec copy -an -f rtp rtp://127.0.0.1:11111 -vn -acodec copy -f rtp rtp://127.0.0.1:11113
Because RTCP port will be set to the RTP port + 1 automatically, or you’d get the bind failed error while playing.
https://ffmpeg.org/ffmpeg-protocols.html#rtp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With