mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 10:44:52 +01:00
bitwarden
This commit is contained in:
@@ -19,7 +19,7 @@ elif sys.platform == "darwin":
|
|||||||
elif sys.platform == "win32":
|
elif sys.platform == "win32":
|
||||||
ops = "win"
|
ops = "win"
|
||||||
try:
|
try:
|
||||||
opts, args = getopt.getopt(sys.argv[1:], "a:r:fp:d:s:", ["command=", "help", "output=", "backup"])
|
opts, args = getopt.getopt(sys.argv[1:], "ta:r:fp:d:s:", ["command=", "help", "output=", "backup"])
|
||||||
except getopt.GetoptError as err:
|
except getopt.GetoptError as err:
|
||||||
# print help information and exit:
|
# print help information and exit:
|
||||||
print(str(err)) # will print something like "option -a not recognized"
|
print(str(err)) # will print something like "option -a not recognized"
|
||||||
@@ -30,6 +30,7 @@ output = None
|
|||||||
_DEV = "gopro9_1"
|
_DEV = "gopro9_1"
|
||||||
_SEQUENCES = []
|
_SEQUENCES = []
|
||||||
_FLIP = False
|
_FLIP = False
|
||||||
|
_TEST = False
|
||||||
if ops == "win":
|
if ops == "win":
|
||||||
_SOURCE_DIR = "p:\\imported\\"
|
_SOURCE_DIR = "p:\\imported\\"
|
||||||
else:
|
else:
|
||||||
@@ -47,6 +48,8 @@ for o, a in opts:
|
|||||||
_SOURCE_DIR = a
|
_SOURCE_DIR = a
|
||||||
elif o in ("-a", "--action"):
|
elif o in ("-a", "--action"):
|
||||||
_ACTION = a
|
_ACTION = a
|
||||||
|
elif o in ("-t", "--test"):
|
||||||
|
_TEST = True
|
||||||
elif o in ("-s", "--sequence"):
|
elif o in ("-s", "--sequence"):
|
||||||
a = a.split(",")
|
a = a.split(",")
|
||||||
for s in a:
|
for s in a:
|
||||||
@@ -117,11 +120,16 @@ if _ACTION == "join":
|
|||||||
f.write("# Files to join\n")
|
f.write("# Files to join\n")
|
||||||
f.close()
|
f.close()
|
||||||
f = open("video.txt", "a")
|
f = open("video.txt", "a")
|
||||||
|
final_size = 0
|
||||||
for p in parts:
|
for p in parts:
|
||||||
f.write(f"file '{p}'\n")
|
f.write(f"file '{p}'\n")
|
||||||
|
file_stats = os.stat(p)
|
||||||
|
final_size += file_stats.st_size / (1024 * 1024)
|
||||||
f.close()
|
f.close()
|
||||||
|
print(final_size)
|
||||||
print(_FULL_PATH)
|
print(_FULL_PATH)
|
||||||
|
if _TEST:
|
||||||
|
input(" ???? ")
|
||||||
# if _FLIP:
|
# if _FLIP:
|
||||||
# if ops == "win":
|
# if ops == "win":
|
||||||
# myCmd = 'ffmpeg -display_rotation 180 -f concat -i video.txt -vcodec copy -acodec copy ' + export_name
|
# myCmd = 'ffmpeg -display_rotation 180 -f concat -i video.txt -vcodec copy -acodec copy ' + export_name
|
||||||
@@ -163,9 +171,11 @@ if _ACTION == "join":
|
|||||||
print(myCmd)
|
print(myCmd)
|
||||||
print(f"Joining {len(parts)} files...")
|
print(f"Joining {len(parts)} files...")
|
||||||
ff = FfmpegProgress(myCmd)
|
ff = FfmpegProgress(myCmd)
|
||||||
with tqdm(total=100, position=1, desc="Convert") as pbar:
|
# with tqdm(total=100, position=1, desc="Convert") as pbar:
|
||||||
for progress in ff.run_command_with_progress():
|
# for progress in ff.run_command_with_progress():
|
||||||
pbar.update(progress - pbar.n)
|
# pbar.update(progress - pbar.n)
|
||||||
|
|
||||||
|
file_stats = os.stat(file_name)
|
||||||
|
|
||||||
# get the output
|
# get the output
|
||||||
print(ff.stderr)
|
print(ff.stderr)
|
||||||
|
|||||||
Reference in New Issue
Block a user