diff --git a/edit.py b/edit.py index f659a6d..0ea433b 100755 --- a/edit.py +++ b/edit.py @@ -117,7 +117,7 @@ if __name__ == '__main__': info = get_info(api, clip['streams'][i]) videos.append({ 'oshash': clip['streams'][i], - 'path': info['path'], + 'path': os.path.join(prefix, info['path']), 'resolution': info['resolution'], 'in': stream_in, 'out': stream_out, diff --git a/ffmpeg.py b/ffmpeg.py index 31dae70..faf45f9 100755 --- a/ffmpeg.py +++ b/ffmpeg.py @@ -1,4 +1,5 @@ #!/usr/bin/python3 +import math import json import os import subprocess @@ -71,13 +72,15 @@ for clip in edit: '-ac', '2', '-b:a', '192k', ] + clip_duration = math.ceil((clip['out'] - clip['in']) / (1/25)) * 1/25 + cmd = [ 'ffmpeg', '-nostats', '-loglevel', 'error', '-ss', str(clip['in']), '-i', clip['path'] ] + options + [ - '-t', str(clip['out'] - clip['in']), + '-t', str(clip_duration), out ] run(cmd)