Overview:
I’m only using VLC on a single Linux system (Ubuntu), to pull all the low-res streams from my cams, by creating a vlm.conf file to tell VLC where to fetch the feeds from, how to arrange them into a mosaic, and then present the output to the screen/monitor of that same linux system.
Note: since VLC also runs on Windows & Mac, theoretically this should work as well on those systems (although I have only attempted this on Linux so far).
Prerequisites:
Linux system having a graphical environment (aka xorg-server) and the latest VLC player installed.
Next, you will need to create one custom config file, and create one blank jpeg image file of specific height/width.
Details:
Creating the proper vlm.conf syntax really is the "secret sauce" here. It took me tons of googling, reading the docs, and various examples to finally figure it out enough to author this little gem . . .
Step 1 - Create a new text file called “mosaic-vlm.conf”, and put the following in it :
Code: Select all
### VLC (VLM) configuration: A 3x3 grid (9) tile mosaic of 8 IP Cam sources
## 1 ##
new IPC1 broadcast enabled
setup IPC1 option rtsp-tcp=enabled
setup IPC1 option rtsp-user=yourusername
setup IPC1 option rtsp-pwd=yourpassword
setup IPC1 input "rtsp://ipaddress1:554/cam/realmonitor?channel=1&subtype=1"
setup IPC1 output #duplicate{dst=mosaic-bridge{id=1},select=video}
## 2 ##
new IPC2 broadcast enabled
setup IPC2 option rtsp-tcp=enabled
setup IPC2 option rtsp-user=yourusername
setup IPC2 option rtsp-pwd=yourpassword
setup IPC2 input "rtsp://ipaddress2:554/cam/realmonitor?channel=1&subtype=1"
setup IPC2 output #duplicate{dst=mosaic-bridge{id=2},select=video}
## 3 ##
new IPC3 broadcast enabled
setup IPC3 option rtsp-tcp=enabled
setup IPC3 option rtsp-user=yourusername
setup IPC3 option rtsp-pwd=yourpassword
setup IPC3 input "rtsp://ipaddress3:554/cam/realmonitor?channel=1&subtype=1"
setup IPC3 output #duplicate{dst=mosaic-bridge{id=3},select=video}
## 4 ##
new IPC4 broadcast enabled
setup IPC4 option rtsp-tcp=enabled
setup IPC4 option rtsp-user=yourusername
setup IPC4 option rtsp-pwd=yourpassword
setup IPC4 input "rtsp://ipaddress4:554/cam/realmonitor?channel=1&subtype=1"
setup IPC4 output #duplicate{dst=mosaic-bridge{id=4},select=video}
## 5 ##
new IPC5 broadcast enabled
setup IPC5 option rtsp-tcp=enabled
setup IPC5 option rtsp-user=yourusername
setup IPC5 option rtsp-pwd=yourpassword
setup IPC5 input "rtsp://ipaddress5:554/cam/realmonitor?channel=1&subtype=1"
setup IPC5 output #duplicate{dst=mosaic-bridge{id=5},select=video}
## 6 ##
new IPC6 broadcast enabled
setup IPC6 option rtsp-tcp=enabled
setup IPC6 option rtsp-user=yourusername
setup IPC6 option rtsp-pwd=yourpassword
setup IPC6 input "rtsp://ipaddress6:554/cam/realmonitor?channel=1&subtype=1"
setup IPC6 output #duplicate{dst=mosaic-bridge{id=6},select=video}
## 7 ##
new IPC7 broadcast enabled
setup IPC7 option rtsp-tcp=enabled
setup IPC7 option rtsp-user=yourusername
setup IPC7 option rtsp-pwd=yourpassword
setup IPC7 input "rtsp://ipaddress7:554/cam/realmonitor?channel=1&subtype=1"
setup IPC7 output #duplicate{dst=mosaic-bridge{id=7},select=video}
## 8 ##
new IPC8 broadcast enabled
setup IPC8 option rtsp-tcp=enabled
setup IPC8 option rtsp-user=yourusername
setup IPC8 option rtsp-pwd=yourpassword
setup IPC8 input "rtsp://ipaddress8:554/cam/realmonitor?channel=1&subtype=1"
setup IPC8 output #duplicate{dst=mosaic-bridge{id=8},select=video}
## MOSAIC ##
new mosaic broadcast enabled
setup mosaic option image-fps=4/1
setup mosaic input /path/the/image/1600x1024.jpg
setup mosaic output #transcode{sfilter=mosaic{width=1600,height=1024,rows=3,cols=3,borderw=2,borderh=2,position=1,order="6,4,2,7,1,5,8,3"},vcodec=mp4v}:display
## Launch ##
control IPC1 play
control IPC2 play
control IPC3 play
control IPC4 play
control IPC5 play
control IPC6 play
control IPC7 play
control IPC8 play
control mosaic play
Step 2 - Next, you will need to create a jpeg image file named “1600x1024.jpg”. Obviously, by the name, you need to make the image 1600px wide and 1024px tall. You can make it all one color, black, white, etc . . . (mine is dark gray). Save this file on your system, and make sure the path in the file above matches so VLC can find it.
At this point, you should now have your own custom “mosaic-vlm.conf” file, and one blank jpeg file called “1600x1024.jpg”. Now all that’s left is to launch VLC !!! But don’t do it from the GUI icon/menu.
Step 3 - Drop down to a terminal window, make sure you are in the same location of that conf file, and launch VLC from the CLI, using the following syntax :
Code: Select all
vlc -I dummy --image-duration -1 --vlm-conf mosaic-vlm.conf
Side-notes:
Changing the screen size. You can try any height/width you like, as VLC will try to automatically resize each camera view. There are two key areas that need modification: Firstly, you need a new blank jpeg file to the new size. Next, you need to edit the values in the “sfilter=” line ( width=1600,height=1024 ).
Changing Number of camera’s. In the “sfilter=” line, the “row=3,cols=3,” is how you define the mosaic grid.
order="6,4,2,7,1,5,8,3" < - - you can define any order of your cams on the mosaic.
option rtsp-tcp=enabled < - - this was needed to make the rstp streams more reliable.
--image-duration -1 < - - this CLI arg is needed to keep the VLC screen open.
General bandwidth concerns < - - As not to draw too much traffic/resources and not saturate my my home LAN, I decided to employ two measures; a) pull only the low-resolution streams (aka subtype 1) from the cameras, and b) drop the frame-rate on subtype 1 all the cams to a slow 4 FPS.
Passwords < - - So “I” have created a basic user on all my cams just for viewing and playback. I set its password very plain-jane, just alphanumeric, no special characters that could potentially conflict with the config file.
FFMPEG < - - In addition to VLC, you may need to also install ffmpeg to gain all the popular codecs, etc...
What’s next?? Other ideas??
Well, now that I proved this works on my main linux system, I’m likely going to purchase a Raspberry Pi 4 and install Raspbian (linux) on it. At that point, the Pi system should be able handle the workload of driving this VLC display on a dedicated HDMI screen mounted in my hallway 24/7.
“omxplayer” you say ?? Yes ! That is (and would be) my 1st choice as this has native Pi hardware support - yet I think VLC has OpenMax support as well, now that I remember. Anyway, at the time of this write-up, I did not own a Pi, which is needed to actually run the omxplayer (as it does not support i386/x64 systems). Therefore, this VLC experiment was/is plan-B.
PLEX. If you run a local Plex server, you might even reconfigure the VLM to do an VOD to Plex, that way you could call this mosiac view from your TV streamer and phone(s) plex app.
Plan-C ?? Another option for the Pi, would be to install an Android OS with Google Play store. At that point, one could just load the default Amcrest Pro mobile app onto the Pi. With big a touch-screen HDMI monitor, you’d have the ultimate montage viewing terminal !!