settings flag to use new cut detection
This commit is contained in:
parent
6deaca8161
commit
11915abcf5
2 changed files with 15 additions and 3 deletions
|
|
@ -23,6 +23,7 @@ import pillow_avif
|
|||
from pillow_heif import register_heif_opener
|
||||
|
||||
from .chop import Chop, make_keyframe_index
|
||||
from .cutdetection import detect_cuts
|
||||
from .utils import AspectRatio
|
||||
|
||||
|
||||
|
|
@ -469,17 +470,26 @@ def timeline(video, prefix, modes=None, size=None):
|
|||
size = [64, 16]
|
||||
if isinstance(video, str):
|
||||
video = [video]
|
||||
if settings.CUT_DETECTION == 'oxtimelines':
|
||||
cuts = [
|
||||
'-c', os.path.join(prefix, 'cuts.json'),
|
||||
]
|
||||
else:
|
||||
cuts = []
|
||||
|
||||
cmd = [os.path.normpath(os.path.join(settings.BASE_DIR, '../bin/oxtimelines')),
|
||||
'-s', ','.join(map(str, reversed(sorted(size)))),
|
||||
'-m', ','.join(modes),
|
||||
'-o', prefix,
|
||||
'-c', os.path.join(prefix, 'cuts.json'),
|
||||
] + video
|
||||
] + cuts + video
|
||||
# print(cmd)
|
||||
p = subprocess.Popen(cmd, stdin=subprocess.PIPE,
|
||||
close_fds=True)
|
||||
p.wait()
|
||||
|
||||
if settings.CUT_DETECTION != 'oxtimelines':
|
||||
cuts = detect_cuts(video)
|
||||
with open(os.path.join(prefix, 'cuts.json'), "w") as fd:
|
||||
json.dump(cuts, fd)
|
||||
|
||||
def average_color(prefix, start=0, end=0, mode='antialias'):
|
||||
height = 64
|
||||
|
|
|
|||
|
|
@ -222,6 +222,8 @@ USE_VP9 = True
|
|||
FFMPEG_SUPPORTS_VP9 = True
|
||||
FFMPEG_DEBUG = False
|
||||
|
||||
CUT_DETECTION = "oxtimelines"
|
||||
|
||||
#=========================================================================
|
||||
#Pan.do/ra related settings settings
|
||||
#to customize, create local_settings.py and overwrite keys
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue