chcp 1251 nul echo off setlocal EnableDelayedExpansi on set dir Users

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
chcp 1251 >nul
@echo off
setlocal EnableDelayedExpansion
set dir=C:\Users\%USERNAME%\Desktop\TL
set ffmpegpath=C:\ffmpeg\bin\ffmpeg.exe
if exist %dir (
echo ok
) else (
mklink /D %dir% "C:\Users\%USERNAME%\Dropbox (Ма-Няня)\TL"
)
set year=%date:~-4%
set month=%date:~3,2%
if "%month:~0,1%" == " " set month=0%month:~1,1%
set day=%date:~0,2%
if "%day:~0,1%" == "0" (
echo day ok
) else (
if "%day:~0,1%" == "1" (
echo day ok
) else (
if "%day:~0,1%" == "2" (
echo day ok
) else (
if "%day:~0,1%" == "3" (
echo day ok
) else (
set day=%date:~7,2%
)
)
)
)
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 secs=%time:~6,2%
if "%secs:~0,1%" == " " set secs=0%secs:~1,1%
set IP=%1
set name=%2
if exist %dir%\%name% (
echo camera folder exists, ok
) else (
md %dir%\%name%
)
set dir=%dir%\%name%
if exist %dir%\%year%.%month% (
echo month folder exists, ok
) else (
md %dir%\%year%.%month%
)
set dir=%dir%\%year%.%month%
if exist %dir%\%day% (
echo day folder exists, ok
) else (
md %dir%\%day%
)
set dir=%dir%\%day%
set mytime=%hour%-%min%-%secs%
%ffmpegpath% -rtsp_transport tcp -y -i "rtsp://%IP%/cam0_0" -r 1 -vf fps=fps=1/120 -vframes 1 -f image2 "%dir%\%mytime%.jpg"