-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtranscode.py
More file actions
24 lines (19 loc) · 869 Bytes
/
transcode.py
File metadata and controls
24 lines (19 loc) · 869 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
import os
import shutil
import sys
import subprocess
import autoImp as ai
def pathFormatter(path):
formattedPath = "\ ".join(path.split(" "))
return formattedPath
SCREEN_FOLDER = "/Users/maxvanlaarhoven/Documents/Screenshots/"
STORAGE_FOLDER = "/Volumes/Samsung T5/Video/ScreenRecStorage/"
fileList = ai.fileFinder(SCREEN_FOLDER, [".mov"])
for file in fileList:
inputFile = pathFormatter(file)
outputFile = "Screenshots/Export".join(str(inputFile[:-4]+".mp4").split("Screenshots"))
command = "HandBrakeCLI --preset-import-file /Users/maxvanlaarhoven/Documents/Screenshots/ScreenRec.json -Z "+'"ScreenRec"'+" -i "+inputFile+" -o "+outputFile
subprocess.call(command, shell=True)
shutil.move(file,STORAGE_FOLDER)
path = "/Users/maxvanlaarhoven/Documents/Screenshots/Screen Recording 2020-04-26 at 13.16.09.mov"
print(pathFormatter(path))