Skip to content

Commit

Permalink
Update ts2mp4.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
ShikOfTheRa committed Apr 28, 2023
1 parent 7b47cb2 commit be17c42
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions HDZERO TS Utility/ts2mp4.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ if [%1]==[] goto TASK_menu
@echo off
cls
set PROCESSERROR=0
cd %app_path%
if exist running.txt del running.txt
if exist filelist.txt del filelist.txt
del /f *.hdz >NUL
if exist *.hdz del /f *.hdz >NUL
timeout /t 2 /nobreak >NUL

:: Start
Expand Down Expand Up @@ -42,20 +41,20 @@ if %ERRORLEVEL% NEQ 0 (SET PROCESSERROR=1)
:: Concatenate smaller TS Files to a single MP4
for /f "tokens=1-8 delims=:./ " %%G in ("%date%/%time%") do (set filedate=%%I_%%H_%%G_%%J_%%K)

ffmpeg.exe -y -f concat -safe 0 -i filelist.txt -c copy HDZERO_%filedate%.mp4
%app_path%ffmpeg -y -f concat -safe 0 -i filelist.txt -c copy HDZERO_%filedate%.mp4
if %ERRORLEVEL% NEQ 0 (SET PROCESSERROR=1)

:: Upscale if specified

if 2==%1 ffmpeg.exe -y -i HDZERO_%filedate%.mp4 -vf scale=iw*2:ih*2 -preset slow -crf 18 UPSCALED_HDZERO_%filedate%.mp4
if 2==%1 %app_path%ffmpeg -y -i HDZERO_%filedate%.mp4 -vf scale=iw*2:ih*2 -preset slow -crf 18 UPSCALED_HDZERO_%filedate%.mp4
if %ERRORLEVEL% NEQ 0 (SET PROCESSERROR=1)

:: Clean up

if exist running.txt del running.txt
if %ERRORLEVEL% NEQ 0 (SET PROCESSERROR=1)

del /f *.hdz >NUL
if exist *.hdz del /f *.hdz >NUL

if exist filelist.txt del filelist.txt
if %ERRORLEVEL% NEQ 0 (SET PROCESSERROR=1)
Expand Down

0 comments on commit be17c42

Please sign in to comment.