mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-30 22:25:19 +00:00 
			
		
		
		
	[ffpmeg] Allow --ffmpeg-location to be a file with different name
				
					
				
			This commit is contained in:
		| @@ -111,19 +111,14 @@ class FFmpegPostProcessor(PostProcessor): | |||||||
|                     return |                     return | ||||||
|                 elif not os.path.isdir(location): |                 elif not os.path.isdir(location): | ||||||
|                     basename = os.path.splitext(os.path.basename(location))[0] |                     basename = os.path.splitext(os.path.basename(location))[0] | ||||||
|                     if basename not in programs: |                     basename = next((p for p in programs if basename.startswith(p)), 'ffmpeg') | ||||||
|                         self.report_warning( |                     dirname = os.path.dirname(os.path.abspath(location)) | ||||||
|                             'Cannot identify executable %s, its basename should be one of %s. ' |  | ||||||
|                             'Continuing without ffmpeg.' % |  | ||||||
|                             (location, ', '.join(programs))) |  | ||||||
|                         self._versions = {} |  | ||||||
|                         return None |  | ||||||
|                     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, os.path.join(location, p)) for p in programs) |                     (p, os.path.join(dirname, p)) for p in programs) | ||||||
|  |                 self._paths[basename] = location | ||||||
|                 self._versions = dict( |                 self._versions = dict( | ||||||
|                     (p, get_ffmpeg_version(self._paths[p])) for p in programs) |                     (p, get_ffmpeg_version(self._paths[p])) for p in programs) | ||||||
|         if self._versions is None: |         if self._versions is None: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 pukkandan
					pukkandan