diff --git a/edit.py b/edit.py index ec31b5e..492ff15 100755 --- a/edit.py +++ b/edit.py @@ -43,17 +43,18 @@ def sort_clips(clips, sort): if __name__ == '__main__': import sys edit_id = sys.argv[1] + if len(sys.argv) > 2: + sort_by = sys.argv[2] + else: + sort_by = 'year' api = ox.API(base_url + '/api/') api.signin(**credentials) edit = api.getEdit(id=edit_id)['data'] - with open('%s_info.json' % normalize(edit_id), 'w') as fd: - json.dump(edit, fd, indent=4, ensure_ascii=False) - videos = [] subtitles = [] position = 0 - for clip in sort_clips(edit['clips'], 'year'): + for clip in sort_clips(edit['clips'], sort_by): part_pos = 0 for i, duration in enumerate(clip['durations']): diff --git a/ffmpeg.py b/ffmpeg.py index 3fa8978..3075ad7 100755 --- a/ffmpeg.py +++ b/ffmpeg.py @@ -54,6 +54,7 @@ for clip in edit: ] cmd = [ 'ffmpeg', + '-nostats', '-loglevel', 'error', '-ss', str(clip['in']), '-i', clip['path'] ] + options + [