Try Encoding Before Upload
This commit is contained in:
parent
bfbbe06cd2
commit
1e039fb1c9
@ -12,7 +12,7 @@ q = queue.Queue()
|
|||||||
base_uri = ""
|
base_uri = ""
|
||||||
isUpload = False
|
isUpload = False
|
||||||
uq = queue.Queue()
|
uq = queue.Queue()
|
||||||
|
eq = queue.Queue()
|
||||||
|
|
||||||
class downloader(XiGuaLiveApi):
|
class downloader(XiGuaLiveApi):
|
||||||
files = []
|
files = []
|
||||||
@ -116,10 +116,22 @@ def download(path=datetime.strftime(datetime.now(), "%Y%m%d_%H%M.ts")):
|
|||||||
f.close()
|
f.close()
|
||||||
if n:
|
if n:
|
||||||
isUpload = True
|
isUpload = True
|
||||||
uq.put(path)
|
eq.put(path)
|
||||||
print("{} : Download Daemon Quiting".format(datetime.strftime(datetime.now(), "%y%m%d %H%M")))
|
print("{} : Download Daemon Quiting".format(datetime.strftime(datetime.now(), "%y%m%d %H%M")))
|
||||||
|
|
||||||
|
|
||||||
|
def encode():
|
||||||
|
i = eq.get()
|
||||||
|
while True:
|
||||||
|
os.system("ffmpeg -i {} -c:a copy -c:v copy -f mp4 {}".format(i,i[:-3] + ".mp4"))
|
||||||
|
if config["mv"]:
|
||||||
|
shutil.move(i, config["mtd"])
|
||||||
|
elif config["del"]:
|
||||||
|
os.remove(i)
|
||||||
|
uq.put(i[:-3] + ".mp4")
|
||||||
|
i = eq.get()
|
||||||
|
|
||||||
|
|
||||||
def upload(date=datetime.strftime(datetime.now(), "%Y_%m_%d")):
|
def upload(date=datetime.strftime(datetime.now(), "%Y_%m_%d")):
|
||||||
print("{} : Upload Daemon Starting".format(datetime.strftime(datetime.now(), "%y%m%d %H%M")))
|
print("{} : Upload Daemon Starting".format(datetime.strftime(datetime.now(), "%y%m%d %H%M")))
|
||||||
i = uq.get()
|
i = uq.get()
|
||||||
@ -138,11 +150,7 @@ def upload(date=datetime.strftime(datetime.now(), "%Y_%m_%d")):
|
|||||||
b.preUpload(VideoPart(i, os.path.basename(i)))
|
b.preUpload(VideoPart(i, os.path.basename(i)))
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
os.remove(i)
|
||||||
if config["mv"]:
|
|
||||||
shutil.move(i, config["mtd"])
|
|
||||||
elif config["del"]:
|
|
||||||
os.remove(i)
|
|
||||||
i = uq.get()
|
i = uq.get()
|
||||||
|
|
||||||
print("{} : Upload Daemon Quiting".format(datetime.strftime(datetime.now(), "%y%m%d %H%M")))
|
print("{} : Upload Daemon Quiting".format(datetime.strftime(datetime.now(), "%y%m%d %H%M")))
|
||||||
|
Reference in New Issue
Block a user