bitwarden

This commit is contained in:
jaydee
2024-09-25 00:06:02 +02:00
parent b5007388de
commit fe6b846f8d

View File

@@ -196,52 +196,53 @@ if _ACTION == "join":
os.remove("video.txt") os.remove("video.txt")
if _ACTION == "encode": if _ACTION == "encode":
if ops == "win": for _DAY_DIR in _DAY_DIRS:
_FULL_PATH = _SOURCE_DIR + "\\" + _DEV + "\\" + _DAY_DIR + "\\" if ops == "win":
else: _FULL_PATH = _SOURCE_DIR + "\\" + _DEV + "\\" + _DAY_DIR + "\\"
_FULL_PATH = _SOURCE_DIR + "/" + _DEV + "/" + _DAY_DIR + "/"
if os.path.exists(_FULL_PATH):
if os.path.exists(_FULL_PATH + "100GOPRO"):
_FULL_PATH = _FULL_PATH + "100GOPRO"
parts = []
for filename in os.listdir(_FULL_PATH):
if filename.startswith("joined_") and filename.endswith(".MP4"):
parts.append(filename)
else:
sys.exit()
for p in parts:
export_name = "encoded_" + p
if _FLIP:
if ops == "win":
myCmd = [
"ffmpeg", "-display_rotation", "180", "-i", p, "-c:v", "hevc_amf", "-rc", "cqp", "-qp_i", "42", "-qp_p", "42", "-quality", "quality", "-crf", "25", "-y", export_name, "-f", "null", "/dev/null",
]
else:
myCmd = [
"/opt/ffmpeg/ffmpeg", "-display_rotation", "180", "-i", p, "-c:v", "hevc_amf", "-rc", "cqp", "-qp_i", "42", "-qp_p", "42", "-quality", "quality", "-crf", "25", "-y", export_name, "-f", "null", "/dev/null",
]
else: else:
if ops == "win": _FULL_PATH = _SOURCE_DIR + "/" + _DEV + "/" + _DAY_DIR + "/"
myCmd = [ if os.path.exists(_FULL_PATH):
"ffmpeg", "-i", p, "-c:v", "hevc_amf", "-rc", "cqp", "-qp_i", "42", "-qp_p", "42", "-quality", "quality", "-crf", "25", "-y", export_name , "-f", "null", "/dev/null", if os.path.exists(_FULL_PATH + "100GOPRO"):
] _FULL_PATH = _FULL_PATH + "100GOPRO"
parts = []
for filename in os.listdir(_FULL_PATH):
if filename.startswith("joined_") and filename.endswith(".MP4"):
parts.append(filename)
else:
sys.exit()
for p in parts:
export_name = "encoded_" + p
if _FLIP:
if ops == "win":
myCmd = [
"ffmpeg", "-display_rotation", "180", "-i", p, "-c:v", "hevc_amf", "-rc", "cqp", "-qp_i", "42", "-qp_p", "42", "-quality", "quality", "-crf", "25", "-y", export_name, "-f", "null", "/dev/null",
]
else:
myCmd = [
"/opt/ffmpeg/ffmpeg", "-display_rotation", "180", "-i", p, "-c:v", "hevc_amf", "-rc", "cqp", "-qp_i", "42", "-qp_p", "42", "-quality", "quality", "-crf", "25", "-y", export_name, "-f", "null", "/dev/null",
]
else: else:
myCmd = [ if ops == "win":
"/opt/ffmpeg/ffmpeg", "-i", p, "-c:v", "hevc_amf", "-rc", "cqp", "-qp_i", "42", "-qp_p", "42", "-quality", "quality", "-crf", "25", "-y", export_name , "-f", "null", "/dev/null", myCmd = [
] "ffmpeg", "-i", p, "-c:v", "hevc_amf", "-rc", "cqp", "-qp_i", "42", "-qp_p", "42", "-quality", "quality", "-crf", "25", "-y", export_name , "-f", "null", "/dev/null",
print(myCmd) ]
print(f"Encoding files...") else:
ff = FfmpegProgress(myCmd) myCmd = [
with tqdm(total=100, position=1, desc="Convert") as pbar: "/opt/ffmpeg/ffmpeg", "-i", p, "-c:v", "hevc_amf", "-rc", "cqp", "-qp_i", "42", "-qp_p", "42", "-quality", "quality", "-crf", "25", "-y", export_name , "-f", "null", "/dev/null",
for progress in ff.run_command_with_progress(): ]
pbar.update(progress - pbar.n) print(myCmd)
print(f"Encoding files...")
ff = FfmpegProgress(myCmd)
with tqdm(total=100, position=1, desc="Convert") as pbar:
for progress in ff.run_command_with_progress():
pbar.update(progress - pbar.n)
# get the output # get the output
print(ff.stderr) print(ff.stderr)
#ffmpeg -i .\GH010149.MP4 -c:v hevc_amf -rc cqp -qp_i 42 -qp_p 42 -quality quality -crf 25 output7.mp4 #ffmpeg -i .\GH010149.MP4 -c:v hevc_amf -rc cqp -qp_i 42 -qp_p 42 -quality quality -crf 25 output7.mp4