now temporary files are cleaned up

This commit is contained in:
Kjistóf 2017-01-15 21:29:09 +01:00
parent ecadd61ef8
commit 3ef8be152b

View File

@ -1,5 +1,5 @@
from subprocess import call, Popen, PIPE from subprocess import call, Popen, PIPE
from os import listdir from os import listdir, remove
from re import match from re import match
from sys import argv from sys import argv
from enum import Enum from enum import Enum
@ -62,8 +62,14 @@ with open('list.txt', 'w') as f:
for i in range(timesLoop): for i in range(timesLoop):
print("file '{}'".format(shorterFile), file=f) print("file '{}'".format(shorterFile), file=f)
call(('/usr/bin/env', 'ffmpeg', '-f', 'concat', '-i', 'list.txt', '-c', 'copy', 'loopedvideo.mp4')) call(('/usr/bin/env', 'ffmpeg', '-f', 'concat', '-i', 'list.txt', '-c', 'copy', 'loopedvideo.mp4'))
call(('/usr/bin/env', 'ffmpeg', '-i', 'loopedvideo.mp4', call(('/usr/bin/env', 'ffmpeg', '-i', 'loopedvideo.mp4',
'-i', FILES[Stream.AUDIO], '-i', FILES[Stream.AUDIO],
'-map', '0', '-map', '1', '-map', '0', '-map', '1',
'-c', 'copy', 'output.mp4')) '-c', 'copy', 'output.mp4'))
remove(FILES[Stream.AUDIO])
remove(FILES[Stream.VIDEO])
remove('list.txt')
remove('loopedvideo.mp4')