|
|
@@ -12,22 +12,25 @@ if len(sys.argv) != 2:
|
|
|
sys.exit()
|
|
|
|
|
|
fname=sys.argv[1]
|
|
|
+out_fname=os.path.join(RAW_PATH, os.path.basename(fname).replace('flv','mp4'))
|
|
|
+in_fname=fname
|
|
|
+if os.path.isfile(out_fname):
|
|
|
+ print("file out exists")
|
|
|
+ sys.exit()
|
|
|
if fname.endswith("flv"):
|
|
|
- out_fname=os.path.join(RAW_PATH, os.path.basename(fname).replace('flv','mp4'))
|
|
|
- in_fname=fname
|
|
|
- if os.path.isfile(out_fname):
|
|
|
- print("file out exists")
|
|
|
- sys.exit()
|
|
|
- process=[ 'ffmpeg',
|
|
|
- '-loglevel', 'error',
|
|
|
- '-i', in_fname,
|
|
|
- '-c', 'copy',
|
|
|
- '-movflags', '+faststart',
|
|
|
- '-f','mp4',
|
|
|
- out_fname
|
|
|
- ]
|
|
|
+ process=[ 'ffmpeg',
|
|
|
+ '-loglevel', 'error',
|
|
|
+ '-i', in_fname,
|
|
|
+ '-c', 'copy',
|
|
|
+ '-movflags', '+faststart',
|
|
|
+ '-f','mp4',
|
|
|
+ out_fname
|
|
|
+ ]
|
|
|
+
|
|
|
+ print(" ".join(process))
|
|
|
+ proc=Popen(process, universal_newlines=True)
|
|
|
+ proc.wait()
|
|
|
+else:
|
|
|
+ os.rename(in_fname,out_fname);
|
|
|
|
|
|
- print(" ".join(process))
|
|
|
- proc=Popen(process, universal_newlines=True)
|
|
|
- proc.wait()
|
|
|
- d.insert_raw(file_info(out_fname))
|
|
|
+d.insert_raw(file_info(out_fname))
|