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