relative path
This commit is contained in:
parent
1f761f360b
commit
7f1eae9c66
|
@ -183,18 +183,16 @@ def concatenate_movies(fp_final: str, list_fp_movies: List[str]):
|
|||
list_concat.append(f"""file '{fp_part}'""")
|
||||
|
||||
# save this list
|
||||
fp_list = fp_final[:-3] + "txt"
|
||||
fp_list = "tmp_move.txt"
|
||||
with open(fp_list, "w") as fa:
|
||||
for item in list_concat:
|
||||
fa.write("%s\n" % item)
|
||||
|
||||
cmd = f'ffmpeg -f concat -safe 0 -i {fp_list} -c copy {fp_final}'
|
||||
dp_movie = os.path.split(fp_final)[0]
|
||||
if len(dp_movie) > 0:
|
||||
subprocess.call(cmd, shell=True, cwd=dp_movie)
|
||||
else:
|
||||
subprocess.call(cmd, shell=True)
|
||||
os.remove(fp_list)
|
||||
if os.path.isfile(fp_final):
|
||||
print(f"concatenate_movies: success! Watch here: {fp_final}")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue