File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 6
6
import subprocess
7
7
import distutils .command .clean
8
8
import distutils .spawn
9
+ from distutils .version import StrictVersion
9
10
import glob
10
11
import shutil
11
12
@@ -346,6 +347,19 @@ def get_extensions():
346
347
347
348
ffmpeg_exe = distutils .spawn .find_executable ('ffmpeg' )
348
349
has_ffmpeg = ffmpeg_exe is not None
350
+ if has_ffmpeg :
351
+ try :
352
+ ffmpeg_version = subprocess .run (
353
+ 'ffmpeg -version | head -n1' , shell = True ,
354
+ stdout = subprocess .PIPE ).stdout .decode ('utf-8' )
355
+ ffmpeg_version = ffmpeg_version .split ('version' )[- 1 ].split ()[0 ]
356
+ if StrictVersion (ffmpeg_version ) >= StrictVersion ('4.3' ):
357
+ print (f'ffmpeg { ffmpeg_version } not supported yet, please use ffmpeg 4.2.' )
358
+ has_ffmpeg = False
359
+ except (IndexError , ValueError ):
360
+ print ('Error fetching ffmpeg version, ignoring ffmpeg.' )
361
+ has_ffmpeg = False
362
+
349
363
print ("FFmpeg found: {}" .format (has_ffmpeg ))
350
364
351
365
if has_ffmpeg :
You can’t perform that action at this time.
0 commit comments