mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 10:44:52 +01:00
bitwarden
This commit is contained in:
@@ -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"
|
||||||
else:
|
parts = []
|
||||||
myCmd = [
|
for filename in os.listdir(_FULL_PATH):
|
||||||
"/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",
|
if filename.startswith("joined_") and filename.endswith(".MP4"):
|
||||||
]
|
parts.append(filename)
|
||||||
print(myCmd)
|
else:
|
||||||
print(f"Encoding files...")
|
sys.exit()
|
||||||
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
|
for p in parts:
|
||||||
print(ff.stderr)
|
export_name = "encoded_" + p
|
||||||
#ffmpeg -i .\GH010149.MP4 -c:v hevc_amf -rc cqp -qp_i 42 -qp_p 42 -quality quality -crf 25 output7.mp4
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user