]> git.bitcoin.ninja Git - youtube-dl/commitdiff
FFmpegPostProcessor: print the command line used if the --verbose option is given
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sat, 12 Oct 2013 11:49:27 +0000 (13:49 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sat, 12 Oct 2013 11:49:27 +0000 (13:49 +0200)
youtube_dl/PostProcessor.py
youtube_dl/utils.py

index fbf8a7f98ffc67792c48de2cb21a1536ffba08ac..0479591f00c49fb1a4e2205c7cf4dc805ee04122 100644 (file)
@@ -83,6 +83,8 @@ class FFmpegPostProcessor(PostProcessor):
                + opts +
                [encodeFilename(self._ffmpeg_filename_argument(out_path))])
 
+        if self._downloader.params.get('verbose', False):
+            self._downloader.to_screen(u'[debug] ffmpeg command line: %s' % shell_quote(cmd))
         p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
         stdout,stderr = p.communicate()
         if p.returncode != 0:
index 82a1daeb9075a056aa908e0a91bbd83b8897673a..0457f3dedb06bce5fdce6cff1bf87b074b7206da 100644 (file)
@@ -9,6 +9,7 @@ import io
 import json
 import locale
 import os
+import pipes
 import platform
 import re
 import socket
@@ -927,3 +928,7 @@ class locked_file(object):
 
     def read(self, *args):
         return self.f.read(*args)
+
+
+def shell_quote(args):
+    return ' '.join(map(pipes.quote, args))