I was just stuck in creating a batch file to record a stream from CCTV. Previously, this worked on a Ubuntu server in code as follows:
cvlc -d --sout "#transcode{vcodec=FLV1,vb=512,fps=3,acodec=none,sfilter=marq{marquee=' %d.%m.%Y %H.%M.%S',opacity=200,size=20}}:std{access=file,mux=ffmpeg{mux=flv},dst=/storage/surveillance/$date/${name[$i]}/$curdate.flv}" --ttl=127 "http:// cameralogin@camerapassword @cam_ip/cgi-bin/cmd/encoder?&${analog[$i]}&GET_STREAM" --http-reconnect --http-continuous --sout-mux-caching=1500 --udp-caching=6000 --tcp-caching=6000
I got an HTTP stream from the camera in MJPG, which I can open from cmd using this
vlc.exe "http:// cameralogin@camerapassword @cam_ip/cgi-bin/cmd/encoder?&$CHANNEL=1&GET_STREAM"
But I am stuck when I try to save it to a file, adding this to the previous command:
--sout "#transcode{vcodec=FLV1,vb=512,fps=3,acodec=none,sfilter=marq{marquee=' %date% %time%',opacity=200,size=20}}:std{access=file,mux=ffmpeg{mux=flv},dst=%archive%\%name%\%date%\%time%.flv}"
VLC opens, but there is no output video and file in the path. Drive F is a local hard drive, login and password are directly to the camera. The package is opened from the local administrator.
The full file is as follows:
:: Set encoding for cyrillyc symvols @chcp 866 :: Some vars for easy edit in future :: Choosing cam :: set analog=CHANNEL=1 set analog=CHANNEL=2 :: set analog=CHANNEL=3 :: set analog=CHANNEL=4 :: Choose folder to save :: set name="2 " set name="1 " :: set name="_" :: set name="1 2" :: Path to archive set archive="F:\Archive\" :: Move to vlc.exe folder cd "c:\Program Files (x86)\VideoLAN\VLC" :: Record Video vlc.exe