prefix path
This commit is contained in:
parent
609a1209ab
commit
8325174995
2 changed files with 5 additions and 2 deletions
2
edit.py
2
edit.py
|
@ -117,7 +117,7 @@ if __name__ == '__main__':
|
||||||
info = get_info(api, clip['streams'][i])
|
info = get_info(api, clip['streams'][i])
|
||||||
videos.append({
|
videos.append({
|
||||||
'oshash': clip['streams'][i],
|
'oshash': clip['streams'][i],
|
||||||
'path': info['path'],
|
'path': os.path.join(prefix, info['path']),
|
||||||
'resolution': info['resolution'],
|
'resolution': info['resolution'],
|
||||||
'in': stream_in,
|
'in': stream_in,
|
||||||
'out': stream_out,
|
'out': stream_out,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
import math
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -71,13 +72,15 @@ for clip in edit:
|
||||||
'-ac', '2',
|
'-ac', '2',
|
||||||
'-b:a', '192k',
|
'-b:a', '192k',
|
||||||
]
|
]
|
||||||
|
clip_duration = math.ceil((clip['out'] - clip['in']) / (1/25)) * 1/25
|
||||||
|
|
||||||
cmd = [
|
cmd = [
|
||||||
'ffmpeg',
|
'ffmpeg',
|
||||||
'-nostats', '-loglevel', 'error',
|
'-nostats', '-loglevel', 'error',
|
||||||
'-ss', str(clip['in']),
|
'-ss', str(clip['in']),
|
||||||
'-i', clip['path']
|
'-i', clip['path']
|
||||||
] + options + [
|
] + options + [
|
||||||
'-t', str(clip['out'] - clip['in']),
|
'-t', str(clip_duration),
|
||||||
out
|
out
|
||||||
]
|
]
|
||||||
run(cmd)
|
run(cmd)
|
||||||
|
|
Loading…
Reference in a new issue