move after render

This commit is contained in:
j 2026-02-03 18:15:08 +01:00
commit 4faef5e1dd

View file

@ -556,10 +556,11 @@ def render_all(options):
if '/audio' in timeline: if '/audio' in timeline:
ext = '.wav' ext = '.wav'
out = '%s' % timeline.replace('.kdenlive', ext) out = '%s' % timeline.replace('.kdenlive', ext)
tmp_out = '%s' % timeline.replace('.kdenlive', ".tmp" + ext)
cmd = get_melt() + [ cmd = get_melt() + [
timeline, timeline,
'-quiet', '-quiet',
'-consumer', 'avformat:%s' % out, '-consumer', 'avformat:%s' % tmp_out,
] ]
if ext == '.wav': if ext == '.wav':
cmd += ['vn=1'] cmd += ['vn=1']
@ -571,6 +572,7 @@ def render_all(options):
cmd += ['vcodec=libx264', 'x264opts=keyint=1', 'crf=15'] cmd += ['vcodec=libx264', 'x264opts=keyint=1', 'crf=15']
if needs_update(timeline, out): if needs_update(timeline, out):
subprocess.call(cmd) subprocess.call(cmd)
shutil.move(tmp_out, out)
if ext == '.wav' and timeline.endswith('audio.kdenlive'): if ext == '.wav' and timeline.endswith('audio.kdenlive'):
cmd = [ cmd = [
'ffmpeg', '-y', 'ffmpeg', '-y',
@ -695,9 +697,10 @@ def render_all(options):
if '/audio' in timelines[0]: if '/audio' in timelines[0]:
ext = '.wav' ext = '.wav'
out = base_prefix / (timeline + ext) out = base_prefix / (timeline + ext)
tmp_out = base_prefix / (timeline + ".tmp" +ext)
cmd = get_melt() + timelines + [ cmd = get_melt() + timelines + [
'-quiet', '-quiet',
'-consumer', 'avformat:%s' % out, '-consumer', 'avformat:%s' % tmp_out,
] ]
if ext == '.wav': if ext == '.wav':
cmd += ['vn=1'] cmd += ['vn=1']
@ -709,6 +712,7 @@ def render_all(options):
cmd += ['vcodec=libx264', 'x264opts=keyint=1', 'crf=15'] cmd += ['vcodec=libx264', 'x264opts=keyint=1', 'crf=15']
if needs_update(timelines[0], out): if needs_update(timelines[0], out):
cmds.append(cmd) cmds.append(cmd)
shutil.move(tmp_out, out)
for src, out1, out2 in ( for src, out1, out2 in (
("audio-front.wav", "fl.wav", "fr.wav"), ("audio-front.wav", "fl.wav", "fr.wav"),