diff --git a/utils/ffmpeg.py b/utils/ffmpeg.py index fca6054..651f4c8 100755 --- a/utils/ffmpeg.py +++ b/utils/ffmpeg.py @@ -27,15 +27,11 @@ def concatenate_video(temp, output, encoder): audio = '' if encoder == 'x265': - # Idk method to make concatenation work with x265 right away - tmp = temp / 'tmp.mp4' - cmd = f' ffmpeg -y -hide_banner -loglevel error -f concat -safe 0 -i {temp / "concat"} ' \ - f'{audio} -c copy -map 0 -y "{tmp}"' + cmd = f' ffmpeg -y -fflags +genpts -hide_banner -loglevel error -f concat -safe 0 -i {temp / "concat"} ' \ + f'{audio} -c copy -movflags frag_keyframe+empty_moov -map 0 -f mp4 - | ffmpeg -y -hide_banner -loglevel error -i - -c copy {output} ' concat = subprocess.run(cmd, shell=True, stdout=PIPE, stderr=STDOUT).stdout - cmd = f'ffmpeg -y -hide_banner -loglevel error -i {tmp} -c copy {output}' - subprocess.run(cmd, shell=True, stdout=PIPE, stderr=STDOUT).stdout else: cmd = f' ffmpeg -y -hide_banner -loglevel error -f concat -safe 0 -i {temp / "concat"} ' \