as much ai as possible
This commit is contained in:
parent
a66ddf294d
commit
f712a46c4a
1 changed files with 18 additions and 0 deletions
18
render.py
18
render.py
|
|
@ -122,6 +122,22 @@ def compose(clips, target=150, base=1024, voice_over=None, options=None):
|
|||
if subs:
|
||||
scene["subtitles"] = subs
|
||||
|
||||
selected_clips_length = 0
|
||||
selected_clips = []
|
||||
non_ai_clips = []
|
||||
for clip in clips:
|
||||
if 'ai' in clip:
|
||||
selected_clips.append(clip)
|
||||
selected_clips_length += clip['duration']
|
||||
else:
|
||||
non_ai_clips.append(clip)
|
||||
|
||||
while selected_clips_length < target and non_ai_clips:
|
||||
clip = random_choice(seq, non_ai_clips, pop=True)
|
||||
selected_clips.append(clip)
|
||||
selected_clips_length += clip['duration']
|
||||
|
||||
clips = selected_clips
|
||||
clip = None
|
||||
while target - length > 0 and clips:
|
||||
'''
|
||||
|
|
@ -789,6 +805,8 @@ def generate_clips(options):
|
|||
clip = {}
|
||||
durations = []
|
||||
for e in item.models.Item.objects.filter(data__title=i.data['title']):
|
||||
if 'skip' in e.data.get('tags', []):
|
||||
continue
|
||||
if 'type' not in e.data:
|
||||
print("ignoring invalid video %s (no type)" % e)
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue