Converting (nearly) any video feed into MJPEG for SmartTiles
I’m using a Samsung SmartCam Pro HD which supported MJPEG over HTTP when I got it, and then… it didn’t. Come to find out, Samsung pushed out a firmware update that removed all non-RTSP streams and apparently it’s never coming back. Thanks a ton, Samsung.
Anyway, this left me with no ability to stream my video feed to SmartTiles so I went looking for a solution. What I found is that VLC does a pretty good job of converting video streams into various formats. This will require a computer capable of running VLC 24/7. In my case, I’m running Windows but VLC is available for most platforms and my approach only requires a CLI, so you might be able to get this going on something like an RPi. Here’s what you need:
- A system to run VLC on that is running full time. In the example below, I’m running it on a Windows system with an IP of 192.168.1.100 using port 8000
- Recent version of VLC (I’m using 2.1.5 on Windows as the 2.2.x releases have some critical bugs on Win64)
- A stream URL for your existing camera that VLC supports (RTSP or whatever). For a Samsung SmartCam Pro HD with an IP of 192.168.1.200 and the password set to “password” that URL would be:
rtsp://admin:password@192.168.1.200/profile3/media.smp
Here’s how I’m launching VLC under Windows. Linux/Mac should work similarly but I haven’t tested them. This will run VLC in a command window without the GUI components which is handy for automation purposes:
vlc.exe -I dummy --play-and-exit rtsp://admin:password@192.168.1.200/profile3/media.smp --sout=#transcode{acodec=none,vcodec=mjpg,vb=512,width=480,height=320}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=192.168.1.100:8000/mjpeg.jpg}
This will start a server which will present a SmartTiles-compatible MJPEG stream available at the URL: http://192.168.1.100:8000/mjpeg.jpg
I’m re-sizing the incoming stream down to 480x320 which is the size of a “medium” SmartTiles video stream in my (limited) testing. You can set the size to be whatever you like in the string. If you want to convert to a higher resolution, use a higher-res source stream from your camera.
For reference, if anyone is using the Samsung SmartCam HD Pro model SNH-P6410BN, these are the available RTSP streams that I’m aware of as of firmware 1.07. Everything else has apparently been disabled by Samsung.
1080P h264 30fps: rtsp://admin:password@192.168.1.200/profile5/media.smp
720P h264 30fps: rtsp://admin:password@192.168.1.200/profile4/media.smp
640x360 h264 30fps: rtsp://admin:password@192.168.1.200/profile3/media.smp
640x360 h264 20fps: rtsp://admin:password@192.168.1.200/profile2/media.smp
1080P MJPEG: rtsp://admin:password@192.168.1.200/profile1/media.smp
@Lgkahn @mba0823 @chriswheat all appear to be using this camera. Hopefully this might be of some help.