Advertisement
DePhoegon

Library Transcode&compactor

Aug 21st, 2017
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.42 KB | None | 0 0
  1. :: For use with updated measures, checks task scheduler instead of Bat files (as method has changed)
  2. :: Removes Old Tasks, to keep scheduler clean (requires VLC to be finished, which prevents accidental ending of recording)
  3. @echo off
  4. set HB="C:\Program Files\HandBrake\handbrakecli"
  5. set PRE=--preset-import-gui --preset
  6. set PRVH=LibupVHS
  7. set PRTS=LibupTVS
  8. set INVH=Z:Z:\VHS\
  9. set INVH2=Z:\VHS-Extras\
  10. set INVH3=Z:\Videos\VHS\
  11. set INTS=Z:\Videos\TVShowwAdsTS\
  12. set INVS=Z:\Videos\TVMovieswAds\
  13. set FTP=Z:\Videos\Hold\
  14. set FTPH=Z:\Videos\Hold\Listed\
  15. set TSCK=0
  16. set TSM=0
  17. set F=*.ts
  18. if EXIST %INVS%%F% ( goto TSKCHV ) else ( goto TSKCHVE )
  19. :TSKCHV
  20. move %INVS%%F% %FTP%%F%
  21. for %%a in (%FTP%%F%) do (
  22. Schtasks /query /tn %%~na >NUL 2>&1
  23. if %errorlevel% EQU 0 ( schtasks /delete /tn "%%~na" )
  24. )
  25. move %FTP%%F% %INVS%%F%
  26. :TSKCHVE
  27. if EXIST %INTS%%F% ( goto TSKCHT ) else ( goto TSKCHTE )
  28. :TSKCHT
  29. move %INTS%%F% %FTP%%F%
  30. for %%a in (%FTP%%F%) do (
  31. Schtasks /query /tn %%~na >NUL 2>&1
  32. if %errorlevel% EQU 0 ( schtasks /delete /tn "%%~na" )
  33. )
  34. move %FTP%%F% %INTS%%F%
  35. :TSKCHTE
  36. echo echo off > temp.bat
  37. attrib +h temp.bat
  38. echo echo Files Started Converting to h265 on %date% ^> Completed.txt >> temp.bat
  39. echo attrib +h Completed.txt >> temp.bat
  40. echo echo -- ^> Transcoding-In-Progress >> temp.bat
  41. echo echo call Completed.txt ^> Check-Progress.bat >> temp.bat
  42. set TSM=0
  43. if EXIST %INVH%*.mov goto VHSST
  44. goto VHSSK
  45. :VHSST
  46. move "%INVH%*.mov" %FTP%
  47. goto VHSEP
  48. :VHS2
  49. set TSM=1
  50. if EXIST "%INVH2%*.mov" goto VHSST2
  51. goto VHSSK
  52. :VHSST2
  53. move %INVH2%*.mov %FTP%
  54. goto VHSEP
  55. :VHS3
  56. set TSM=2
  57. if EXIST "%INVH3%*.mov" goto VHSST3
  58. goto VHSSK
  59. :VHSST3
  60. move %INVH3%*.mov %FTP%
  61. goto VHSEP
  62. :: Room for more VHS folders based on storage orginization
  63. :VHSEP
  64. for %%a in (%FTP%*.mov) do (
  65. if %TSM% EQU 0 (echo move %INVH%%%~na.mov %FTP% >> temp.bat)
  66. if %TSM% EQU 1 (echo move %INVH2%%%~na.mov %FTP% >> temp.bat)
  67. if %TSM% EQU 2 (echo move %INVH3%%%~na.mov %FTP% >> temp.bat)
  68. if %TSM% EQU 0 (echo %HB% -i %%a -o %INVH%%%~na.mp4 %PRE% "%PRVH%" >> temp.bat)
  69. if %TSM% EQU 1 (echo %HB% -i %%a -o %INVH2%%%~na.mp4 %PRE% "%PRVH%" >> temp.bat)
  70. if %TSM% EQU 2 (echo %HB% -i %%a -o %INVH3%%%~na.mp4 %PRE% "%PRVH%" >> temp.bat)
  71. echo echo %%~na.mp4 ^>^> Completed.txt >> temp.bat
  72. echo del %%a >> temp.bat
  73. if %TSM% EQU 0 (move %%a %INVH%)
  74. if %TSM% EQU 1 (move %%a %INVH2%)
  75. if %TSM% EQU 2 (move %%a %INVH3%)
  76. )
  77. :VHSSK
  78. if %TSM% EQU 0 goto VHS2
  79. if %TSM% EQU 1 goto VHS3
  80. set TSM=0
  81. if EXIST %INTS%*.ts goto TVSST
  82. goto TVSSK
  83. :TVSST
  84. move %INTS%*.ts %FTP%
  85. goto TSLP
  86. :TVSSK
  87. set TSM=1
  88. if EXIST %INVS%*.ts goto TMSST
  89. goto TSSK
  90. :TMSST
  91. move %INVS%*.ts %FTP%
  92. goto TSLP
  93. :TSLP
  94. for %%a in (%FTP%*.ts) do (
  95. if %TSM% EQU 0 (echo move %INTS%%%~na.ts %FTP% >> temp.bat)
  96. if %TSM% EQU 1 (echo move %INVS%%%~na.ts %FTP% >> temp.bat)
  97. if %TSM% EQU 0 (echo %HB% -i %%a -o %INTS%%%~na.mp4 %PRE% "%PRTS%" >> temp.bat)
  98. if %TSM% EQU 1 (echo %HB% -i %%a -o %INVS%%%~na.mp4 %PRE% "%PRTS%" >> temp.bat)
  99. echo echo %%~na.mp4 ^>^> Completed.txt >> temp.bat
  100. echo del %%a >> temp.bat
  101. if %TSM% EQU 0 (move %%a %INTS%)
  102. if %TSM% EQU 1 (move %%a %INVS%)
  103. )
  104. :TSSK
  105. if %TSM% EQU 0 goto TVSSK
  106. echo del Transcoding-In-Progress >> temp.bat
  107. echo echo Finished ^>^> Completed.txt >> temp.bat
  108. echo attrib -h Completed.txt >> temp.bat
  109. echo start Check-Progress.bat >> temp.bat
  110. echo del Check-Progress.bat >> temp.bat
  111. echo attrib -h temp.bat >> temp.bat
  112. echo del temp.bat >> temp.bat
  113. start quiet temp.bat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement