diff --git a/handle_imported_video.py b/handle_imported_video.py index 62599a2..f10bc9b 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -23,7 +23,7 @@ elif sys.platform == "darwin": elif sys.platform == "win32": ops = "win" try: - opts, args = getopt.getopt(sys.argv[1:], "q:x:ta:r:fp:d:s:z:w:", ["command=", "help", "output=", "backup"]) + opts, args = getopt.getopt(sys.argv[1:], "q:x:ta:r:fp:d:s:z:w:jge", ["command=", "help", "output=", "backup"]) except getopt.GetoptError as err: # print help information and exit: print(str(err)) # will print something like "option -a not recognized" @@ -33,7 +33,7 @@ output = None # QJ : getopts _DEV = "gopro9_1" _SEQUENCES = [] -_FLIP = False +_GPS = _FLIP = _JOIN = _ENCODE= False _TEST = False _FILTER = False _QUALITY = ["35","35","25"] @@ -52,6 +52,12 @@ for o, a in opts: _DAY_DIRS = a.split(",") elif o in ("-f", "--flip"): _FLIP = True + elif o in ("-j", "--flip"): + _JOIN = True + elif o in ("-g", "--flip"): + _GPS = True + elif o in ("-e", "--flip"): + _ENCODE = True elif o in ("-w", "--flip"): _FILTER = True _PATERN = a @@ -420,27 +426,33 @@ def encode_videos(_DEV,_SOURCE_DIR,_DAY_DIRS): except: print(f"Failed to move {export_name}") - - -if _ACTION == "modify_date": - modify_creation_date(_FILE,_SRC_FILE) - - -if _ACTION == "flip": - flip_videos(_DEV, _SOURCE_DIR,_DAY_DIRS) - -if _ACTION == "join": - join_videos(_DEV, _SOURCE_DIR,_DAY_DIRS) - -if _ACTION == "encode": - encode_videos(_DEV, _SOURCE_DIR,_DAY_DIRS) - -if _ACTION == "all": +if _GPS: export_gps(_DEV, _SOURCE_DIR,_DAY_DIRS) +if _FLIP: flip_videos(_DEV, _SOURCE_DIR,_DAY_DIRS) - join_videos(_DEV, _SOURCE_DIR,_DAY_DIRS) +if _JOIN: + join_videos(_DEV, _SOURCE_DIR,_DAY_DIRS) +if _ENCODE: + encode_videos(_DEV, _SOURCE_DIR,_DAY_DIRS) + +# if _ACTION == "modify_date": +# modify_creation_date(_FILE,_SRC_FILE) + +# if _ACTION == "flip": +# flip_videos(_DEV, _SOURCE_DIR,_DAY_DIRS) + +# if _ACTION == "join": +# join_videos(_DEV, _SOURCE_DIR,_DAY_DIRS) + +# if _ACTION == "encode": +# encode_videos(_DEV, _SOURCE_DIR,_DAY_DIRS) -if _ACTION == "get_metadata": - modify_creation_date("/media/nas/nas-photo/imported/gopro9_1/2025-06-02", "GH010256.MP4") -if _ACTION == "export_gps": - export_gps(_DEV, _SOURCE_DIR,_DAY_DIRS) \ No newline at end of file +# if _ACTION == "all": +# export_gps(_DEV, _SOURCE_DIR,_DAY_DIRS) +# flip_videos(_DEV, _SOURCE_DIR,_DAY_DIRS) +# join_videos(_DEV, _SOURCE_DIR,_DAY_DIRS) + +# if _ACTION == "get_metadata": +# modify_creation_date("/media/nas/nas-photo/imported/gopro9_1/2025-06-02", "GH010256.MP4") +# if _ACTION == "export_gps": +# export_gps(_DEV, _SOURCE_DIR,_DAY_DIRS) \ No newline at end of file