ffmpeg – Creating an RTSP stream and converting it to WebRTC using MediaMTX

I am trying to create a RTSP stream using ffmpeg, and using MediaMTX to serve the video in the browser (WebRTC). What is the right way achieve this?

(Note: I’m using wsl2 ubuntu on a Windows machine)

What I tried:

Running MediaMTX:

sudo docker run --rm -it -p 8554:8554 -p 8889:8889 bluenviron/mediamtx

Running ffmpeg:

ffmpeg -stream_loop -1 -re -i ./Big_Buck_Bunny.mp4 -c:v copy -f rtsp rtsp://localhost:8554/output

Getting an error:

Error submitting a packet to the muxer: Broken pipe

When trying to run the ffmpeg with TCP flag:

ffmpeg -stream_loop -1 -re -i ./Big_Buck_Bunny.mp4 -c:v copy -rtsp_transport tcp -f rtsp rtsp://localhost:8554/output

MediaMTX loggs:

closed: WebRTC doesn’t support H264 streams with B-frames

Read more here: Source link