tweaks
This commit is contained in:
parent
debe1837a7
commit
e84ea31147
4 changed files with 15 additions and 30 deletions
12
render.py
12
render.py
|
|
@ -6,8 +6,8 @@ import sys
|
|||
import time
|
||||
|
||||
import ox
|
||||
from pi import random
|
||||
from render_kdenlive import KDEnliveProject
|
||||
from .pi import random
|
||||
from .render_kdenlive import KDEnliveProject
|
||||
|
||||
|
||||
def random_choice(seq, items, pop=False):
|
||||
|
|
@ -97,7 +97,8 @@ def compose(clips, target=150, base=1024):
|
|||
# 50 % chance to blur original from 0 to 30
|
||||
if chance(seq, 0.5):
|
||||
blur = seq() * 3
|
||||
scene['back']['V2'][-1]['filter']['blur'] = blur
|
||||
if blur:
|
||||
scene['back']['V2'][-1]['filter']['blur'] = blur
|
||||
scene['audio']['A1'].append({
|
||||
'duration': clip['duration'],
|
||||
'src': clip['original'],
|
||||
|
|
@ -109,7 +110,7 @@ def compose(clips, target=150, base=1024):
|
|||
return scene
|
||||
|
||||
|
||||
def render(root, scene):
|
||||
def render(root, scene, prefix=''):
|
||||
fps = 24
|
||||
for timeline, data in scene.items():
|
||||
print(timeline)
|
||||
|
|
@ -121,6 +122,5 @@ def render(root, scene):
|
|||
for clip in clips:
|
||||
project.append_clip(track, clip)
|
||||
|
||||
with open(os.path.join(prefix, "%s.kdenlive" % timeline), 'w') as fd:
|
||||
with open(os.path.join(root, prefix + "%s.kdenlive" % timeline), 'w') as fd:
|
||||
fd.write(project.to_xml())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue