diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-04-12 17:15:16 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-04-12 17:15:16 +0200 |
commit | 66398056f17d0a9c04861a98b6e95d70ab08a353 (patch) | |
tree | f1abed179de44ba7ff2570946fed14a34a5800ab /youtube_dl/postprocessor/ffmpeg.py | |
parent | b9c76aa1a9c80013ad4f2f3cd20b98ab1be430ac (diff) | |
parent | 77477fa4c916599e7eaa236a3f3eb5703923cf91 (diff) |
Merge branch 'master' of github.com:rg3/youtube-dl
Diffstat (limited to 'youtube_dl/postprocessor/ffmpeg.py')
-rw-r--r-- | youtube_dl/postprocessor/ffmpeg.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py index 8922920cd..602e370f4 100644 --- a/youtube_dl/postprocessor/ffmpeg.py +++ b/youtube_dl/postprocessor/ffmpeg.py @@ -464,7 +464,11 @@ class FFmpegMetadataPP(FFmpegPostProcessor): filename = info['filepath'] temp_filename = prepend_extension(filename, 'temp') - options = ['-c', 'copy'] + if info['ext'] == u'm4a': + options = ['-vn', '-acodec', 'copy'] + else: + options = ['-c', 'copy'] + for (name, value) in metadata.items(): options.extend(['-metadata', '%s=%s' % (name, value)]) @@ -483,3 +487,17 @@ class FFmpegMergerPP(FFmpegPostProcessor): self.run_ffmpeg_multiple_files(info['__files_to_merge'], filename, args) return True, info + +class FFmpegAudioFixPP(FFmpegPostProcessor): + def run(self, info): + filename = info['filepath'] + temp_filename = prepend_extension(filename, 'temp') + + options = ['-vn', '-acodec', 'copy'] + self._downloader.to_screen(u'[ffmpeg] Fixing audio file "%s"' % filename) + self.run_ffmpeg(filename, temp_filename, options) + + os.remove(encodeFilename(filename)) + os.rename(encodeFilename(temp_filename), encodeFilename(filename)) + + return True, info |