@echo off
rem Перерисовать куски 7,5-15 с и 22,5-30 с в 4 потока и пересклеить с готовыми s0, s2.
cd /d E:\PKSTUDIO\clients\pk_motion
del /q out\seg\p*.mp4 out\seg\q*.txt 2>nul
start "a" /b cmd /c "node tools\pm_capture.mjs --page web\index.html --out out\seg\p1a.mp4 --from 450 --to 675 --port 9350 > out\seg\qa.txt 2>&1"
start "b" /b cmd /c "node tools\pm_capture.mjs --page web\index.html --out out\seg\p1b.mp4 --from 675 --to 900 --port 9351 > out\seg\qb.txt 2>&1"
start "c" /b cmd /c "node tools\pm_capture.mjs --page web\index.html --out out\seg\p3a.mp4 --from 1350 --to 1575 --port 9352 > out\seg\qc.txt 2>&1"
node tools\pm_capture.mjs --page web\index.html --out out\seg\p3b.mp4 --from 1575 --to 1800 --port 9353 > out\seg\qd.txt 2>&1
:wait
timeout /t 5 /nobreak >nul
for %%i in (a b c) do findstr /c:"frames_done" out\seg\q%%i.txt >nul || goto wait
(echo file 's0.mp4'& echo file 'p1a.mp4'& echo file 'p1b.mp4'& echo file 's2.mp4'& echo file 'p3a.mp4'& echo file 'p3b.mp4') > out\seg\list2.txt
C:\Users\PKSTUDIO\.cache\hyperframes\ffmpeg\ffmpeg-9.0.1-essentials_build\bin\ffmpeg.exe -v error -y -f concat -safe 0 -i out\seg\list2.txt -c copy out\pk_motion_video.mp4
echo RERENDER_DONE
