Parade Series - FFMPEG (Stable X64)
延时测试秒表计时器
ini/config.ini
[system]
home=server
store=store\nvr.db
version=V20240312001
verbose=false
[monitor]
list=rtsp00,rtsp01,rtsp02
timeout=30000
[rtsp00]
type=local
device=Surface Camera Front
schema=rtsp
ip=127.0.0.1
port=8554
usr=
pwd=
context=/cam081101
[rtsp01]
type=remote
device=
schema=rtsp
ip=10.10.20.231
port=554
usr=admin
pwd=password
context=
[rtsp02]
type=remote
device=
schema=rtsp
ip=10.10.20.235
port=554
usr=admin
pwd=password
context=
com-cam-to-rtsp.cmd
:: ===========================================================================
:: PLEASE DO NOT EDIT THIS FILE
:: ===========================================================================
@ECHO OFF
:: ===========================================================================@SET DSK=%~d0
@SET PWD=%~dp0@%DSK%
@CD %PWD%:: ===========================================================================@SET ARG-DEVICE=%1@SET NVRHOME=nginx-rtmp\html
FOR /F %%x IN ('linux_date +"%%s%%N"') DO (SET TTSS=%%x
)
@SET TMPLOG=%NVRTMP%\tmp-%TTSS%.log:: ===========================================================================@SET CAM-DEVICE=Surface Camera Front
@SET CAM-LINK=-f dshow -i video="%CAM-DEVICE%"@SET ALPHA=-vcodec libx264 -preset:v ultrafast -tune:v zerolatency
@SET BETA=-an
@SET GAMMA=-rtsp_transport tcp
@SET DELTA=-f rtsp
@SET CAM-TARGET=@SET ARGS=%ALPHA% %BETA% %GAMMA% %DELTA%
@SET ARGS=%ARGS%@SETLOCAL ENABLEDELAYEDEXPANSION@ECHO.
FOR /F %%a IN (' com-get-ini.cmd monitor list ') DO @(@SET cmd_out=%%a@SET MESSAGE=%MESSAGE%!cmd_out!
)
FOR %%a IN ( %MESSAGE% ) DO @(@SET cmd_aaa=%%a@SET cmd_type=@SET cmd_device=@SET cmd_rtsp=@SET cmd_ip=@SET cmd_key=type@SET cmd_line=!cmd_aaa! !cmd_key!FOR /F %%b IN (' com-get-ini !cmd_line! ') DO @(@SET cmd_bbb=%%b)@SET cmd_type=!cmd_bbb!@SET cmd_key=device@SET cmd_line=!cmd_aaa! !cmd_key!FOR /F "tokens=1,2,3,4" %%b IN (' com-get-ini !cmd_line! ') DO @(@SET cmd_bbb=%%b %%c %%d %%e)@IF "!cmd_bbb:~-1!"==" " @SET cmd_bbb=!cmd_bbb:~0,-1!@SET cmd_device=!cmd_bbb!@SET cmd_key=schema@SET cmd_line=!cmd_aaa! !cmd_key!FOR /F %%b IN (' com-get-ini !cmd_line! ') DO @(@SET cmd_bbb=%%b@SET cmd_rtsp=!cmd_rtsp!!cmd_bbb!://)@SET cmd_key=usr@SET cmd_line=!cmd_aaa! !cmd_key!FOR /F %%b IN (' com-get-ini !cmd_line! ') DO @(@SET cmd_bbb=%%b@SET cmd_rtsp=!cmd_rtsp!!cmd_bbb!)@SET cmd_key=pwd@SET cmd_line=!cmd_aaa! !cmd_key!FOR /F %%b IN (' com-get-ini !cmd_line! ') DO @(@SET cmd_bbb=%%b@SET cmd_rtsp=!cmd_rtsp!:!cmd_bbb!)@SET cmd_key=ip@SET cmd_line=!cmd_aaa! !cmd_key!FOR /F %%b IN (' com-get-ini !cmd_line! ') DO @(@SET cmd_bbb=%%b@SET cmd_rtsp=!cmd_rtsp!@!cmd_bbb!)@SET cmd_ip=!cmd_bbb!@SET cmd_key=port@SET cmd_line=!cmd_aaa! !cmd_key!FOR /F %%b IN (' com-get-ini !cmd_line! ') DO @(@SET cmd_bbb=%%b@SET cmd_rtsp=!cmd_rtsp!:!cmd_bbb!)@SET cmd_key=context@SET cmd_line=!cmd_aaa! !cmd_key!FOR /F %%b IN (' com-get-ini !cmd_line! ') DO @(@SET cmd_bbb=%%b@SET cmd_rtsp=!cmd_rtsp!!cmd_bbb!)@IF "!cmd_type!" == "local" @(@SET CAM-LINK=-f dshow -i video="!cmd_device!"@HideExec @ffmpeg !CAM-LINK! %ARGS% !cmd_rtsp!) ELSE @(@ECHO !cmd_rtsp!)
)
@ECHO.:__END__
@CD %PWD%
paths:cam0801:runOnInit: ffmpeg -f dshow -i video="Surface Camera Rear" -vcodec libx264 -preset:v ultrafast -tune:v zerolatency -an -rtsp_transport tcp -f rtsp rtsp://127.0.0.1:8554/cam081101rtsp081101:source: rtsp://127.0.0.1:8554/cam081101
ffplay -window_title cam081101 rtsp://127.0.0.1:8554/cam081101
http://127.0.0.1:8889/rtsp081101/
HideExec.exe
void HideExec( )
{PTSTR pszCmdLine = GetCmdLine();if (pszCmdLine && *pszCmdLine) {PROCESS_INFORMATION pi;STARTUPINFO si;BOOL fSuccess;ZeroMemory(&si, sizeof(si));si.cb = sizeof(si);si.dwFlags = STARTF_USESHOWWINDOW;si.wShowWindow = SW_HIDE;fSuccess = CreateProcess(NULL,pszCmdLine,NULL,NULL,FALSE,CREATE_DEFAULT_ERROR_MODE | CREATE_NO_WINDOW,NULL,NULL,&si,&pi);if (fSuccess) {DWORD dwExitCode = 0;WaitForSingleObject(pi.hProcess, INFINITE);GetExitCodeProcess(pi.hProcess, &dwExitCode);CloseHandle(pi.hProcess);CloseHandle(pi.hThread);ExitProcess(dwExitCode);}}ExitProcess(0x100);
}
PTSTR WINAPI GetCmdLine( )
{PTSTR pszCmdLine = GetCommandLine();if (pszCmdLine) {BOOL fInQuotes = FALSE;while (*pszCmdLine > TEXT(' ') || (*pszCmdLine && fInQuotes)) {if (*pszCmdLine == TEXT('\"'))fInQuotes = ~fInQuotes;++pszCmdLine;}while (*pszCmdLine && *pszCmdLine <= TEXT(' '))++pszCmdLine;}return (pszCmdLine);
}
PresetControl
/
// dwPTZPresetCmd
// [in] SET_PRESET 8 设置预置点
// CLE_PRESET 9 清除预置点
// GOTO_PRESET 39 转到预置点
/
BOOL PresetControl(DWORD dwPTZPresetCmd, DWORD dwPresetIndex);INT parsePresetCommand(CString cmdString) {INT result = 0;if (0 == cmdString.CompareNoCase(_T("SET-PRESET"))) {result = SET_PRESET;}if (0 == cmdString.CompareNoCase(_T("CLE-PRESET"))) {result = CLE_PRESET;}if (0 == cmdString.CompareNoCase(_T("GOTO-PRESET"))) {result = GOTO_PRESET;}return result;
}