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")
if _ACTION == "encode":
if ops == "win":
_FULL_PATH = _SOURCE_DIR + "\\" + _DEV + "\\" + _DAY_DIR + "\\"
else:
_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",
]
for _DAY_DIR in _DAY_DIRS:
if ops == "win":
_FULL_PATH = _SOURCE_DIR + "\\" + _DEV + "\\" + _DAY_DIR + "\\"
else:
if ops == "win":
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",
]
else:
myCmd = [
"/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",
]
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)
_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()
# get the output
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
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:
if ops == "win":
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",
]
else:
myCmd = [
"/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",
]
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
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