Compare commits

...

4 commits

Author SHA1 Message Date
j
3a367e8c73 handle animation clips 2023-10-28 11:25:45 +02:00
j
fee8e821f9 mixed output 2023-10-28 11:24:51 +02:00
j
b571bb2271 import handling 2023-10-28 11:24:43 +02:00
j
af8f7433c3 produce better seeking mp4 files 2023-10-22 11:18:03 +01:00
3 changed files with 22 additions and 6 deletions

View file

@ -43,6 +43,8 @@ class Command(BaseCommand):
clip['editingtags'] = i.data.get('editingtags', [])
if "original" in clip and "foreground" in clip and "background" in clip:
clips.append(clip)
elif "original" in clip and "animation" in clip:
clips.append(clip)
else:
print("ignoring incomplete video", i)

View file

@ -4,6 +4,7 @@ import os
import subprocess
import sys
import time
import shutil
from pathlib import Path
import ox
@ -281,9 +282,13 @@ def render_all(options):
cmd = [
'xvfb-run', '-a',
'melt', timeline,
'-quiet',
'-consumer', 'avformat:%s' % timeline.replace('.kdenlive', ext),
'-quiet'
]
if ext == '.wav':
cmd += ['vn=1']
else:
cmd += ['an=1', 'vcodec=libx264', 'x264opts=keyint=1', 'crf=15']
subprocess.call(cmd)
if ext == '.wav' and timeline.endswith('audio.kdenlive'):
cmd = [
@ -324,18 +329,24 @@ def render_all(options):
"-filter_complex", "[0:a][1:a][2:a][3:a][4:a][5:a]amerge=inputs=6[a]",
"-map", "[a]", "-c:a", "aac", fragment_prefix / "audio-5.1.mp4"
])
cmds.append([
"ffmpeg", "-y",
"-nostats", "-loglevel", "error",
"-i", fragment_prefix / "back.mp4",
"-i", fragment_prefix / "audio-5.1.mp4",
"-c", "copy",
fragment_prefix / "back-5.1.mp4",
])
for cmd in cmds:
#print(" ".join([str(x) for x in cmd]))
subprocess.call(cmd)
'''
shutil.move(fragment_prefix / "back-5.1.mp4", fragment_prefix / "back.mp4")
for fn in (
"audio-A1.wav", "audio-A2.wav", "audio-A3.wav",
"fl.wav", "fr.wav", "fc.wav", "lfe.wav", "bl.wav", "br.wav",
"audio-5.1.mp4", "fl.wav", "fr.wav", "fc.wav", "lfe.wav", "bl.wav", "br.wav",
):
fn = fragment_prefix / fn
if os.path.exists(fn):
os.unlink(fn)
'''
print("Duration - Target: %s Actual: %s" % (target_position, position))
with open(_cache, "w") as fd:
json.dump(_CACHE, fd)

View file

@ -4,6 +4,7 @@ def upgrade_originals():
import item.models
import itemlist.models
nt = itemlist.models.List.objects.get(name='No Type')
no = itemlist.models.List.objects.get(name='New Originals')
for i in nt.get_items(nt.user):
orig = item.models.Item.objects.get(data__title=i.get('title'), data__type=["Original"])
print(i, orig)
@ -14,9 +15,11 @@ def upgrade_originals():
orig.make_poster()
i.data['type'] = ['Empty']
i.save()
no.items.add(orig)
def remove_deselected_files():
import itemlist.models
il = itemlist.models.List.objects.get(name='New Originals')
for i in il.items.all():
changed = False