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")
|
||||
|
||||
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",
|
||||
]
|
||||
_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:
|
||||
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)
|
||||
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
|
||||
# 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