Page 1 of 1

Transcoding RTSP to MJPEG and Streaming Locally

Posted: 25 Jun 2020 01:52
by ctgriffi
Hello, new to the forum and looking for a little help with the following, please and thank you:

I'm trying to use VLC on my Mac to transcode an RTSP stream from a (you guessed it!) IP camera system, and I'd like to end up with a stable MJPEG stream over HTTP on my local network. I have made many, many different attempts via Terminal and the GUI to get this to work, with very limited success:

In Terminal/CLI world, there seem to be many problems on my machine such as "Cannot create vout as Mac OS X interface was not found."

When I attempted to make this all work chiefly through the GUI, I got pretty close, but I was unable to find a place to set the needed "boundary" value which is a must for MJPEG streaming, from what I understand (I was able to set the correct mime value, once I found it in the endless Preferences menu: Preferences > Stream output > Access output > HTTP).

Here is the command that I was most recently attempting to use in Terminal:

/Applications/VLC.app/Contents/MacOs/VLC -I rc -vvv rtsp://admin:######@192.168.1.124:554/cam/realmonitor?channel=4&subtype=00 --sout "#transcode{vcodec=MJPG,vb=1500,scale=1,fps=10,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace;boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=localhost:8080/videostream.cgi}"


Details:
I am on an older MBP, Mojave 10.14.6, and I have the latest VLC available, 3.0.11

Re: Transcoding RTSP to MJPEG and Streaming Locally

Posted: 25 Jun 2020 19:47
by ctgriffi
Still can't get VLC to work correctly in Mac Terminal.

I've searched around online and tried assigning various options and multiple different interfaces to my CLI string, with no luck. It seems like VLC tries to access a Main Video Window and always fails.

Error message in Terminal: failed to load window nib file 'MainWindow'

Final messages in VLC log, before program terminates:
main debug: looking for vout window module matching "any": 1 candidates
macosx debug: Opening video window

Re: Transcoding RTSP to MJPEG and Streaming Locally

Posted: 28 Dec 2020 23:13
by jfix
Hi, as I'd like to do something like you describe I came across your post (maybe too late now), but also one elsewhere which I managed to make work (not without errors, but still it works).

The information is found here: https://support.actiontiles.com/en/comm ... m-to-mjpeg

And the relevant information is this:

Code: Select all

vlc.exe -I dummy -R rtsp://user:password@192.168.1.72/profile5/media.smp --sout "#transcode{vcodec=mjpg,vb=2500,scale=1.0,fps=10,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8888/videostream.cgi}"
Contrary to your attempt, this one uses the "dummy" interface which does not attempt to access the GUI. That's the only difference of interest that I can see.

The commandline output is messy and full of errors, but I can confirm that I can see the mjpeg stream in my browser window. So, at least a first basis for further explorations.

Code: Select all

$ /Applications/VLC.app/Contents/MacOS/VLC -I dummy -R rtsp://l:p@192.168.1.16:554/Sms=5.unicast --sout "#transcode{vcodec=mjpg,vb=2500,scale=1.0,fps=10,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8888/videostream.cgi}" VLC media player 3.0.11.1 Vetinari (revision 3.0.11.1-0-g52483f3ca2) [00007fad06552220] dummy interface: using the dummy interface module... [00007fad0655a870] stream_out_transcode stream out error: cannot find audio encoder (module:any fourcc:none). Take a look few lines earlier to see possible reason. [00007fad0655a870] stream_out_transcode stream out error: cannot create audio chain [00007fad0700e1c0] main decoder error: cannot create packetizer output (alaw) [00007fad06460f20] main decoder error: buffer deadlock prevented [00007fad0700e1c0] main decoder error: buffer deadlock prevented [00007fad0700ea60] videotoolbox generic: Using Video Toolbox to decode 'h264' [00007fad0700ee40] avcodec encoder error: Unknown option "rc_buffer_aggressivity" [00007fad0700ea60] videotoolbox generic: vt cvpx chroma: 420v [swscaler @ 0x7fad075d5000] deprecated pixel format used, make sure you did set range correctly [swscaler @ 0x7fad075d5000] deprecated pixel format used, make sure you did set range correctly [00007fad0700ee40] avcodec encoder error: Unknown option "rc_buffer_aggressivity" [mjpeg @ 0x7fad0785c800] vbv buffer overflow [mjpeg @ 0x7fad0785c800] vbv buffer overflow [mjpeg @ 0x7fad0785c800] vbv buffer overflow [mjpeg @ 0x7fad0785c800] vbv buffer overflow [mjpeg @ 0x7fad0785c800] vbv buffer overflow ...
Hope this helps.