@ -96,6 +96,7 @@ class FFmpegPostProcessor(PostProcessor):
self . _paths = None
self . _versions = None
location = None
if self . _downloader :
prefer_ffmpeg = self . _downloader . params . get ( ' prefer_ffmpeg ' , True )
location = self . _downloader . params . get ( ' ffmpeg_location ' )
@ -118,32 +119,17 @@ class FFmpegPostProcessor(PostProcessor):
location = os . path . dirname ( os . path . abspath ( location ) )
if basename in ( ' ffmpeg ' , ' ffprobe ' ) :
prefer_ffmpeg = True
self . _paths = dict (
( p , os . path . join ( location , p ) ) for p in programs )
self . _versions = dict (
( p , get_ffmpeg_version ( self . _paths [ p ] ) ) for p in programs )
if self . _versions is None :
self . _versions = dict (
( p , get_ffmpeg_version ( p ) ) for p in programs )
self . _paths = dict ( ( p , p ) for p in programs )
if prefer_ffmpeg is False :
prefs = ( ' avconv ' , ' ffmpeg ' )
else :
prefs = ( ' ffmpeg ' , ' avconv ' )
for p in prefs :
if self . _versions [ p ] :
self . basename = p
break
if prefer_ffmpeg is False :
prefs = ( ' avprobe ' , ' ffprobe ' )
else :
prefs = ( ' ffprobe ' , ' avprobe ' )
for p in prefs :
if self . _versions [ p ] :
self . probe_basename = p
self . _paths = dict (
( p , p if location is None else os . path . join ( location , p ) )
for p in programs )
self . _versions = dict (
x for x in (
( p , get_ffmpeg_version ( self . _paths [ p ] ) ) for p in programs )
if x [ 1 ] is not None )
for p in ( ' ffmpeg ' , ' avconv ' ) [ : : - 1 if prefer_ffmpeg is False else 1 ] :
if self . _versions . get ( p ) :
self . basename = self . probe_basename = p
break
@property