Determine output extension based on input
ffmpeg might be able to handle some cases of differing extensions, so I figure just give it a shot and hope it works. What's the worst that could happen?
This commit is contained in:
parent
e523a89d97
commit
ce9f19fd2b
@ -491,7 +491,14 @@ class FFmpegConcatPP(FFmpegPostProcessor):
|
|||||||
#Concat support requires that the IE return '_type' = 'playlist'
|
#Concat support requires that the IE return '_type' = 'playlist'
|
||||||
#Otherwise it silently fail
|
#Otherwise it silently fail
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
filename = info['title'] + u'.mp4' #What could possibly go wrong?
|
#Determine appropriate output extension
|
||||||
|
extlist = []
|
||||||
|
for input_filename in info['__files_to_append']:
|
||||||
|
extlist.append(os.path.splitext(input_filename)[-1])
|
||||||
|
if len(set(extlist)) != 1:
|
||||||
|
self._downloader.report_warning('Not all files are in the same format! Joining the files may fail.')
|
||||||
|
|
||||||
|
filename = info['title'] + extlist[0]
|
||||||
concatargs = ['-f', 'concat']
|
concatargs = ['-f', 'concat']
|
||||||
args = ['-c', 'copy']
|
args = ['-c', 'copy']
|
||||||
self._downloader.to_screen(u'[ffmpeg] Appending files into "%s"' % filename)
|
self._downloader.to_screen(u'[ffmpeg] Appending files into "%s"' % filename)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user