REM be sure "one instance setting is ticked in VLC preferences
@echo off
:loop
REM format datetime for video file
for /f "tokens=2-4 delims=/ " %%a in ('echo %date%') do (set mydate=%%c-%%a-%%b)
for /f "tokens=1-3 delims=/:" %%a in ('echo %time%') do (set mytime=%%a%%b%%c)
set videofile=c:\temp\%mydate%_%mytime%.mp4
REM record 60s of video and dump to location
echo will record to: %videofile%
start "vlcrecord" "c:\vlc\vlc.exe" screen:// :screen-fps=25 :screen-width=1280 :screen-height=720 :screen-top=100 :screen-left=200 :screen-caching=100 :sout=#transcode{venc=x264{bframes=0,nocabac,ref=1,nf,level=13,crf=24,partitions=none},vcodec=h264,fps=25,vb=3000,width=1280,height=720,acodec=none}:duplicate{dst=std{mux=mp4,access=file,dst=%videofile%}}
echo waiting to kill (60s)
ping 192.0.2.2 -n 1 -w 60000 > nul
echo killing recording
start "vlckill" "c:\vlc\vlc.exe" vlc://quit
REM pause 20s to approach monitor
ping 192.0.2.2 -n 1 -w 20000 > nul
REM play newly recorded video
echo playing video
start "vlcplay" "c:\vlc\vlc.exe" "%videofile%"
REM kill after 61 seconds (--play-and-exit switch isn't working for me)
ping 192.0.2.2 -n 1 -w 61000 > nul
start "vlckill" "c:\vlc\vlc.exe" vlc://quit
REM pause for 20 seconds so you can reset
echo pausing for 20 seconds
ping 192.0.2.2 -n 1 -w 20000 > nul
goto loop