-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplexdvr.bat
More file actions
30 lines (22 loc) · 987 Bytes
/
Copy pathplexdvr.bat
File metadata and controls
30 lines (22 loc) · 987 Bytes
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
SET infile=%1
SET tmpfile=%1.mp4
SET scriptlog=[full path to log file]
SET handbrakepath=[full path to handbrakecli]
SET handbrakepresetpath=[full path to handbrake preset json file]
ECHO.
ECHO Starting processing %date% %time%>> %scriptlog%
ECHO Starting handbrake transcode %date% %time%>> %scriptlog%
REM use handbrake to compress the ts into an mp4
%handbrakepath% --preset-import-file %handbrakepresetpath% -Z "PlexDVR" -i %infile% -o %tmpfile%
ECHO Finished transcode %date% %time%>> %scriptlog%
ECHO Starting ffmpeg file conversion %date% %time%>> %scriptlog%
REM use ffmpeg to convert the mp4 back into a ts
ffmpeg -i %tmpfile% -f mpegts -vcodec copy -acodec copy -y %tmpfile%
ECHO Finished conversion %date% %time%>> %scriptlog%
ECHO Moving file %tmpfile% to %infile%>> %scriptlog%
REM replace the original ts file with the compressed version
move /Y %tmpfile% %infile%
ECHO Finished moving>> %scriptlog%
ECHO Finished processing %date% %time%>> %scriptlog%
ECHO.
ECHO.