mirror of
https://gitlab.sectorq.eu/jaydee/imported_video.git
synced 2025-12-14 10:34:53 +01:00
build
This commit is contained in:
@@ -23,7 +23,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:], "q:x:ta:r:fp:d:s:", ["command=", "help", "output=", "backup"])
|
opts, args = getopt.getopt(sys.argv[1:], "q:x:ta:r:fp:d:s:z:", ["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"
|
||||||
@@ -59,6 +59,9 @@ for o, a in opts:
|
|||||||
_TEST = True
|
_TEST = True
|
||||||
elif o in ("-x", "--file"):
|
elif o in ("-x", "--file"):
|
||||||
_FILE = a
|
_FILE = a
|
||||||
|
elif o in ("-z", "--file"):
|
||||||
|
_SRC_FILE = a
|
||||||
|
|
||||||
elif o in ("-s", "--sequence"):
|
elif o in ("-s", "--sequence"):
|
||||||
a = a.split(",")
|
a = a.split(",")
|
||||||
for s in a:
|
for s in a:
|
||||||
@@ -77,6 +80,14 @@ for o, a in opts:
|
|||||||
|
|
||||||
#print(_FULL_PATH)
|
#print(_FULL_PATH)
|
||||||
|
|
||||||
|
def modify_creation_date(path,src_file):
|
||||||
|
create_date = filedate.File(src_file).get()
|
||||||
|
filedate.File(path).set(
|
||||||
|
created = create_date["created"],
|
||||||
|
modified = create_date["modified"],
|
||||||
|
accessed = create_date["accessed"]
|
||||||
|
)
|
||||||
|
|
||||||
def flip_videos(_DEV,_SOURCE_DIR,_DAY_DIRS):
|
def flip_videos(_DEV,_SOURCE_DIR,_DAY_DIRS):
|
||||||
|
|
||||||
for _DAY_DIR in _DAY_DIRS:
|
for _DAY_DIR in _DAY_DIRS:
|
||||||
@@ -149,12 +160,7 @@ def flip_videos(_DEV,_SOURCE_DIR,_DAY_DIRS):
|
|||||||
print(f"Failed to move {export_name}")
|
print(f"Failed to move {export_name}")
|
||||||
|
|
||||||
|
|
||||||
if _ACTION == "flip":
|
def encode_videos(_DEV,_SOURCE_DIR,_DAY_DIRS):
|
||||||
flip_videos(_DEV, _SOURCE_DIR,_DAY_DIRS)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if _ACTION == "join":
|
|
||||||
for _DAY_DIR in _DAY_DIRS:
|
for _DAY_DIR in _DAY_DIRS:
|
||||||
if ops == "win":
|
if ops == "win":
|
||||||
_FULL_PATH = _SOURCE_DIR + "\\" + _DEV + "\\" + _DAY_DIR + "\\"
|
_FULL_PATH = _SOURCE_DIR + "\\" + _DEV + "\\" + _DAY_DIR + "\\"
|
||||||
@@ -233,26 +239,6 @@ if _ACTION == "join":
|
|||||||
|
|
||||||
# print(os.getcwd())
|
# print(os.getcwd())
|
||||||
#status, output = subprocess.getstatusoutput(myCmd)
|
#status, output = subprocess.getstatusoutput(myCmd)
|
||||||
|
|
||||||
if _FLIP:
|
|
||||||
if ops == "win":
|
|
||||||
myCmd = [
|
|
||||||
"ffmpeg", "-f", "concat", "-i", "video.txt", "-c", "copy", "-metadata:s:v:0", "rotate=180","-y", export_name
|
|
||||||
]
|
|
||||||
else:
|
|
||||||
# myCmd = [
|
|
||||||
# "/usr/bin/ffmpeg", "-f", "concat", "-i", "video.txt", "-c", "copy", "-metadata:s:v:0", "rotate=180", "-y", export_name
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ]
|
|
||||||
myCmd = [
|
|
||||||
"/usr/bin/ffmpeg", "-f", "concat", "-i", "video.txt", "-c", "copy", "-metadata:s:v:0", "rotate=0", "-y", export_name
|
|
||||||
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
else:
|
|
||||||
if ops == "win":
|
if ops == "win":
|
||||||
myCmd = [
|
myCmd = [
|
||||||
"ffmpeg", "-f", "concat", "-i", "video.txt","-vcodec", "copy", "-acodec", "copy", "-y", export_name
|
"ffmpeg", "-f", "concat", "-i", "video.txt","-vcodec", "copy", "-acodec", "copy", "-y", export_name
|
||||||
@@ -346,6 +332,16 @@ if _ACTION == "join":
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
if _ACTION == "modify_date":
|
||||||
|
modify_creation_date(_FILE,_SRC_FILE)
|
||||||
|
|
||||||
|
|
||||||
|
if _ACTION == "flip":
|
||||||
|
flip_videos(_DEV, _SOURCE_DIR,_DAY_DIRS)
|
||||||
|
|
||||||
|
if _ACTION == "join":
|
||||||
|
encode_videos(_DEV, _SOURCE_DIR,_DAY_DIRS)
|
||||||
|
|
||||||
if _ACTION == "encode":
|
if _ACTION == "encode":
|
||||||
print("Encode Job")
|
print("Encode Job")
|
||||||
for _DAY_DIR in _DAY_DIRS:
|
for _DAY_DIR in _DAY_DIRS:
|
||||||
|
|||||||
Reference in New Issue
Block a user