From cec6e6fad715f8f08b42d0b54a6e59922a22b591 Mon Sep 17 00:00:00 2001 From: Joseph Rushton Wakeling Date: Mon, 11 Feb 2013 20:01:37 +0100 Subject: [PATCH] [Issue #39] Ensure interim videos are generated with right format. --- ly2video.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ly2video.py b/ly2video.py index e689f12..e453510 100755 --- a/ly2video.py +++ b/ly2video.py @@ -1494,6 +1494,7 @@ def getOutputFile(options): def callFfmpeg(ffmpeg, options, wavPath, outputFile): fps = str(options.fps) framePath = tmpPath('notes', 'frame%d.png') + fileExtension = os.path.splitext(outputFile)[1][1:].strip() if not options.titleAtStart: cmd = [ @@ -1510,7 +1511,7 @@ def callFfmpeg(ffmpeg, options, wavPath, outputFile): # generate silent title video silentAudio = generateSilence(options.titleDuration) titleFramePath = tmpPath('title', 'frame%d.png') - titlePath = tmpPath('title.mpg') + titlePath = tmpPath(''.join(['title.', fileExtension])) cmd = [ ffmpeg, "-f", "image2", @@ -1524,7 +1525,7 @@ def callFfmpeg(ffmpeg, options, wavPath, outputFile): safeRun(cmd, exitcode=14) # generate video with notes - notesPath = tmpPath("notes.mpg") + notesPath = tmpPath(''.join(['notes.', fileExtension])) cmd = [ ffmpeg, "-f", "image2", @@ -1538,7 +1539,7 @@ def callFfmpeg(ffmpeg, options, wavPath, outputFile): safeRun(cmd, exitcode=15) # join the files - joinedPath = tmpPath('joined.mpg') + joinedPath = tmpPath(''.join(['joined.', fileExtension])) if sys.platform.startswith("linux"): safeRun("cat '%s' '%s' > %s" % (titlePath, notesPath, joinedPath), shell=True) elif sys.platform.startswith("win"):