I need to broadcast a local .mp4 file to both RTSP on port 8554 and MJPEG on port 9000. I know VLC/cvlc has this capability, but I'm having issues getting it to work. I'm using vlc v4.0.0-dev (built from source) on ubuntu 18.04.
I can get two separate commands to work, but I want them combined into one so the two streams are always in sync.
here's the rtsp command that's working:
cvlc driver.mp4 --sout '#transcode{vcodec=h264,venc=x264{preset=ultrafast,tune=zerolatency,keyint=1,fps=30},vb=5000}:rtp{sdp=rtsp://:8554/stream}' --no-sout-all --sout-keep --loop
and the mjpeg command that's working:
cvlc driver.mp4 --sout '#transcode{vcodec=MJPG,venc=ffmpeg{strict=1}}:std{access=http{mime=multipart/x-mixed-replace;boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:9000/}' --no-sout-all --sout-keep --loop
How do I combine these two into one command? #duplicate?
I tried on v3.0.8 (with the help of ChatGPT) but one or the other stream would fail. I can get the two to work independently, but I want one command similar to the below code to do both streams so they're always in sync.
cvlc ./driver.mp4 --sout '#duplicate{dst=rtp{sdp=rtsp://:8554/},dst=std{access=http{mime=multipart/x-mixed-replace;boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mjpeg,dst=:9000},select-filter="canvas"}' --no-sout-all --sout-keep --sout-jpeg-quality=80
[edited to improve readability]