File recording 100+ streams won't stop at designated time

Discussion about configuration and usage of VLM (a stream scheduler) within VLC.
markn62
Blank Cone
Blank Cone
Posts: 16
Joined: 31 Jan 2014 21:30

File recording 100+ streams won't stop at designated time

Postby markn62 » 13 Mar 2014 23:04

I'm running VLC ver. 2.1.3 on Win7 quad-core box. The snipped Windows batch script below creates a .conf file then launches VLC reference the created conf file. Doing a few streams is fine. In the actual script the echo section repeats 100+ times. All is well except the streams saving to file don't stop at the designated stop time. Should be 5 seconds short of an hour. Takes an extra 2 to 5 minutes before all video streams stop recording. I'm trying to get this down to under a minute so I can killtask vlc and restart another hour session with the Win scheduler. If killtask is issued too early all the recorded files get corrrupted and won't play.

Am I missing something in the script?
HELP ! ! !

--------------------------------------------------------------
setlocal enableextensions enabledelayedexpansion
::
set year=%date:~12,2%
set month=%date:~4,2%
if "%month:~0,1%" == " " set month=0%month:~1,1%
set day=%date:~7,2%
if "%day:~0,1%" == " " set day=0%day:~1,1%
set hour=%time:~0,2%
if "%hour:~0,1%" == " " set hour=0%hour:~1,1%
set min=%time:~3,2%
if "%min:~0,1%" == " " set min=0%min:~1,1%
set filename=%month%.%day%.%year%_%hour%.%min%
::
set year=%date:~10,4%
set month=%date:~4,2%
if "%month:~0,1%" == " " set month=0%month:~1,1%
set day=%date:~7,2%
if "%day:~0,1%" == " " set day=0%day:~1,1%
set begintime=%year%/%month%/%day%-%hour%:%min%:05
::
set currenttime=%time%
for /F "tokens=1 delims=:" %%h in ('echo %currenttime%') do (set /a hr=%%h)
set /a hr=%hr%+1
if %hr% gtr 24 set hour=00
set endtime=%year%/%month%/%day%-%hr%:%min%:00
::
(
echo new Cam1 broadcast enabled
echo setup Cam1 input rtsp://11.41.123.2/video
echo setup Cam1 output #transcode{acodec=none}:std{access=file{no-overwrite},mux=mp4,dst='C:\<path>\%filename%.mp4'}
echo new Cam1_sched1 schedule enabled
echo setup Cam1_sched1 date %begintime%
echo setup Cam1_sched1 append control Cam1 play
echo new Cam1_sched2 schedule enabled
echo setup Cam1_sched2 date %endtime%
echo setup Cam1_sched2 append control Cam1 stop
) >Camera.conf
::
endlocal
start vlc -I telnet --extraintf --qt-minimized --vlm-conf Camera.conf
EXIT

markn62
Blank Cone
Blank Cone
Posts: 16
Joined: 31 Jan 2014 21:30

Re: File recording 100+ streams won't stop at designated tim

Postby markn62 » 20 Mar 2014 17:33

After running this a week tweaking things a bit I don't have any over-runs anymore. However, I'm having about 30% of the sites stop recording early. No consistency or appearing attributable to anything in particular. Some quit in a few seconds, some a few minutes, some just short of the designtated 15 minutes and some go the distance. I've buffered the input stream as best I know how adding "--live-caching=2000 --rtsp-caching=2000 --realrtsp-caching=2000 --skip-frames --drop-late-frames" to my launch of VLC via telnet script. Hasn't provided enough tolerance to the recordings to bring the failure rate down. This was a common problem I had running multiple instances of VLC on a single core. Now on a quad-core I've tried breaking up the 100 input streams to file in batches of 25 running for instances to one instance running all 100 and every combo in between, single instance is the most reliable of the four options. Scoured Google and this forum for anyone else experiencing similar using an inbound stream to file non-transcoded, but no hits with any meat.

markn62
Blank Cone
Blank Cone
Posts: 16
Joined: 31 Jan 2014 21:30

Re: File recording 100+ streams won't stop at designated tim

Postby markn62 » 21 Mar 2014 20:04

So this project was never completed?

https://wiki.videolan.org/SoC_2008/Enha ... es_of_VLC/

Very unfortunate. :? Being able to save a stream to file, based on VLM scheduler parameters, while continuing to record would solve the issues I describe earlier in this thread.

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: File recording 100+ streams won't stop at designated tim

Postby Sébastien Escudier » 28 Mar 2014 08:32

Look at the log to see why streams are stopping early

markn62
Blank Cone
Blank Cone
Posts: 16
Joined: 31 Jan 2014 21:30

Re: File recording 100+ streams won't stop at designated tim

Postby markn62 » 05 Apr 2014 18:46

I looked over the logs and it didn't tell me much other than a stream stopped so the decoder and muxer were broke down. Once I upped the network cache to 10000 ms streams to file became stable.

I have one issue yet to tackle. The time to break down 100 cameras is about 3 minutes. So 3 minutes out of 15 minutes I can't record waiting to start the next VLM session. I'm not entirely certain if it is VLC taking its time to finish storing off the streams to disk or if it's Win7 doing write-ahead caching. Same problem whether I save to local disk or network share. Once the VLM stop time has been reached, there is still processor activity on the current instance so I can't taskkill or it corrupts the files. If the VLC log had time stampings I could better tell if the problem is with the VLC breakdown process. Any way to time stamp each error in the log?

Four cameras breakdown in 5 seconds or so. 25 takes a minute and 100 takes 3 minutes according to the Win7 task manager. Using VLM with multiple instances of VLC and breaking the 100 streams into four 25 stream groups is not stable. I get IP camera feed errors stating contention between two client sessions simultaneously open.

Any suggestions are appreciated as to how to get VLC to break down faster with many rtsp streams using VLM and one VLC instance?

Thanks for your time...

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: File recording 100+ streams won't stop at designated tim

Postby Sébastien Escudier » 07 Apr 2014 12:54

VLC does not support timestamps logs.
Someone wrote a script to do it on linux :
https://forum.videolan.org/viewtopic.ph ... 25#p358938

markn62
Blank Cone
Blank Cone
Posts: 16
Joined: 31 Jan 2014 21:30

Re: File recording 100+ streams won't stop at designated tim

Postby markn62 » 21 Apr 2014 20:06

After increasing "Live Capture Caching" to 10000, I then got good recordings every "other" 15 minute interval. More recently I discovered the source stream (ip camera) had a 15 minute orphan timout, the same value as my recording interval. Once the orphan timeout was lowered to 1 minute, recordings have been 100%. My script works most reliably creating three .conf files with an equal number of source streams in each, rather than just one. The script then launches three instances of VLC to each run one of the .conf files with a 2 second staggered start to keep quad-core CPU from hitting 100%. FINALLY SOLVED ! ! !


Return to “VLM”

Who is online

Users browsing this forum: No registered users and 2 guests