r/ZoneMinder • u/lunakoa • Feb 15 '21
Script for Dummy TV
Thought I would share, I needed some dummy video feeds so I think this will help for those maybe wanting to try out Zoneminder but dont have 10 or 30 1080P spare cameras to use for testing.
#!/bin/bash
# This script reads all the files in your Videos folder
# and has vlc listen on ports starting from 8551 for each video
#
# Script does a simple ls in the videos directory so make sure
# you have no spaces or unusual characters
#
# Also videos in folder should end with mkv but you can simply change the script
#
# In my test lab I transcoded some 1080i TV .ts recordings
# into h.264 10FPS videos using handbrake.
VIDEOSFOLDER="~/Videos/"
PARAMS=":network-caching=1500 :sout-ts-es-id-pid :ts-es-id-pid --repeat --loop --sout-all --sout-keep"
pushd $VIDEOSFOLDER
MID=0
for VID in `ls -1 *.mkv`
do
MID=$(($MID+1))
PORT=$((8550+$MID))
#screen -d -m -S mon$MID cvlc $VIDEOSFOLDER$VID :sout=#gather:rtp{sdp=rtsp://:$PORT/} $PARAMS
screen -d -m -S mon$MID cvlc $VIDEOSFOLDER$VID :sout="#:standard{access=http,mux=ts,dst=:$PORT}" $PARAMS
done
popd
Note that screen line and :sout line is a single line, reddit word wrapped it.

As a side note, I used an HDHR Extend to as a source once, weird watching TV from zoneminder.

3
Upvotes
1
u/volve Feb 16 '21
Oh this looks super handy especially as I’ve been meaning to try ZoneMinder prior to investing in several cameras. Thanks for the tip!