From 2b9bfd058d7277abfac88c57664421807b372a26 Mon Sep 17 00:00:00 2001 From: Yhancik Date: Sat, 13 Jun 2015 21:35:49 +0200 Subject: [PATCH 1/2] Adding quotes around filespaths --- src/echonest/remix/video.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/echonest/remix/video.py b/src/echonest/remix/video.py index 8349f28..1296ae4 100644 --- a/src/echonest/remix/video.py +++ b/src/echonest/remix/video.py @@ -301,7 +301,7 @@ def sequencefrommov(mov, settings=None, direc=None, pre="frame-", verbose=True): format = "jpeg" if settings is not None: format = settings.imageformat() - cmd = "en-ffmpeg -i " + mov + " -an -sameq " + os.path.join(direc, pre + "%06d." + format) + cmd = "en-ffmpeg -i \"" + mov + "\" -an -sameq " + os.path.join(direc, pre + "%06d." + format) if verbose: log.info(cmd) out = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) @@ -316,7 +316,7 @@ def sequencetomovie(outfile, seq, audio=None, verbose=True): "renders sequence to a movie file, perhaps with an audio track" direc = tempfile.mkdtemp() seq.render(direc, "image-", False) - cmd = "en-ffmpeg -y " + str(seq.settings) + " -i " + os.path.join(direc, "image-%06d." + seq.settings.imageformat()) + cmd = "en-ffmpeg -y \"" + str(seq.settings) + "\" -i " + os.path.join(direc, "image-%06d." + seq.settings.imageformat()) if audio: cmd += " -i " + audio cmd += " -sameq " + outfile @@ -340,7 +340,7 @@ def convertmov(infile, outfile=None, settings=None, verbose=True): raise TypeError("settings arg must be a VideoSettings object") if outfile is None: foo, outfile = tempfile.mkstemp(".flv") - cmd = "en-ffmpeg -y -i " + infile + " " + str(settings) + " -sameq " + outfile + cmd = "en-ffmpeg -y -i \"" + infile + "\" " + str(settings) + " -sameq \"" + outfile + "\"" if verbose: log.info(cmd) out = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) From a200ae822f9adf74e27f2ab41e9d32073a5f3132 Mon Sep 17 00:00:00 2001 From: Yhancik Date: Sat, 13 Jun 2015 22:35:07 +0200 Subject: [PATCH 2/2] Adding quotes around filespaths Adding two, and removed a pair I added in the wrong place --- src/echonest/remix/video.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/echonest/remix/video.py b/src/echonest/remix/video.py index 1296ae4..32c58c2 100644 --- a/src/echonest/remix/video.py +++ b/src/echonest/remix/video.py @@ -316,10 +316,10 @@ def sequencetomovie(outfile, seq, audio=None, verbose=True): "renders sequence to a movie file, perhaps with an audio track" direc = tempfile.mkdtemp() seq.render(direc, "image-", False) - cmd = "en-ffmpeg -y \"" + str(seq.settings) + "\" -i " + os.path.join(direc, "image-%06d." + seq.settings.imageformat()) + cmd = "en-ffmpeg -y " + str(seq.settings) + " -i " + os.path.join(direc, "image-%06d." + seq.settings.imageformat()) if audio: - cmd += " -i " + audio - cmd += " -sameq " + outfile + cmd += " -i \"" + audio + "\"" + cmd += " -sameq \"" + outfile + "\"" if verbose: log.info(cmd) out = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)