projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'gamekings_fix' of https://github.com/rrooij/youtube-dl into rrooij...
[youtube-dl]
/
youtube_dl
/
postprocessor
/
ffmpeg.py
diff --git
a/youtube_dl/postprocessor/ffmpeg.py
b/youtube_dl/postprocessor/ffmpeg.py
index 5ed723bc6cae2a464e34fad6c48b5ba71e62dab9..16a64802a5b4208f4407b58d146e77cf5073378f 100644
(file)
--- a/
youtube_dl/postprocessor/ffmpeg.py
+++ b/
youtube_dl/postprocessor/ffmpeg.py
@@
-52,7
+52,7
@@
class FFmpegPostProcessor(PostProcessor):
def _determine_executables(self):
programs = ['avprobe', 'avconv', 'ffmpeg', 'ffprobe']
def _determine_executables(self):
programs = ['avprobe', 'avconv', 'ffmpeg', 'ffprobe']
- prefer_ffmpeg =
self._downloader.params.get('prefer_ffmpeg', False)
+ prefer_ffmpeg =
False
self.basename = None
self.probe_basename = None
self.basename = None
self.probe_basename = None
@@
-60,6
+60,7
@@
class FFmpegPostProcessor(PostProcessor):
self._paths = None
self._versions = None
if self._downloader:
self._paths = None
self._versions = None
if self._downloader:
+ prefer_ffmpeg = self._downloader.params.get('prefer_ffmpeg', False)
location = self._downloader.params.get('ffmpeg_location')
if location is not None:
if not os.path.exists(location):
location = self._downloader.params.get('ffmpeg_location')
if location is not None:
if not os.path.exists(location):
@@
-478,6
+479,7
@@
class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor):
self._downloader.to_screen('[ffmpeg] There aren\'t any subtitles to convert')
return [], info
self._downloader.to_screen('[ffmpeg] Converting subtitles')
self._downloader.to_screen('[ffmpeg] There aren\'t any subtitles to convert')
return [], info
self._downloader.to_screen('[ffmpeg] Converting subtitles')
+ sub_filenames = []
for lang, sub in subs.items():
ext = sub['ext']
if ext == new_ext:
for lang, sub in subs.items():
ext = sub['ext']
if ext == new_ext:
@@
-485,6
+487,8
@@
class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor):
'[ffmpeg] Subtitle file for %s is already in the requested'
'format' % new_ext)
continue
'[ffmpeg] Subtitle file for %s is already in the requested'
'format' % new_ext)
continue
+ old_file = subtitles_filename(filename, lang, ext)
+ sub_filenames.append(old_file)
new_file = subtitles_filename(filename, lang, new_ext)
if ext == 'dfxp' or ext == 'ttml':
new_file = subtitles_filename(filename, lang, new_ext)
if ext == 'dfxp' or ext == 'ttml':
@@
-492,7
+496,7
@@
class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor):
'You have requested to convert dfxp (TTML) subtitles into another format, '
'which results in style information loss')
'You have requested to convert dfxp (TTML) subtitles into another format, '
'which results in style information loss')
- dfxp_file =
subtitles_filename(filename, lang, ext)
+ dfxp_file =
old_file
srt_file = subtitles_filename(filename, lang, 'srt')
with io.open(dfxp_file, 'rt', encoding='utf-8') as f:
srt_file = subtitles_filename(filename, lang, 'srt')
with io.open(dfxp_file, 'rt', encoding='utf-8') as f:
@@
-510,9
+514,7
@@
class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor):
if new_ext == 'srt':
continue
if new_ext == 'srt':
continue
- self.run_ffmpeg(
- subtitles_filename(filename, lang, ext),
- new_file, ['-f', new_format])
+ self.run_ffmpeg(old_file, new_file, ['-f', new_format])
with io.open(new_file, 'rt', encoding='utf-8') as f:
subs[lang] = {
with io.open(new_file, 'rt', encoding='utf-8') as f:
subs[lang] = {
@@
-520,4
+522,4
@@
class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor):
'data': f.read(),
}
'data': f.read(),
}
- return
[]
, info
+ return
sub_filenames
, info