Skip to content

Commit 9275cc6

Browse files
authored
Enable building torchvision with ffmpeg regardless of version on Linux (#4413)
* Enable building torchvision with ffmpeg regardless of version on Linux * Skip tests with python 3.9 * Removed PY39_SKIP * Cleaned up a bit
1 parent 3380c00 commit 9275cc6

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

setup.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,9 @@ def get_extensions():
360360
has_ffmpeg = False
361361
if has_ffmpeg:
362362
try:
363-
# this splits on both dots and spaces as the output format differs across versions / platforms
364-
ffmpeg_version_str = str(subprocess.check_output(["ffmpeg", "-version"]))
365-
ffmpeg_version = re.split(r"ffmpeg version |\.| |-", ffmpeg_version_str)[1:3]
366-
ffmpeg_version = ".".join(ffmpeg_version)
367-
if StrictVersion(ffmpeg_version) >= StrictVersion('4.3'):
368-
print(f'ffmpeg {ffmpeg_version} not supported yet, please use ffmpeg 4.2.')
369-
has_ffmpeg = False
370-
except (subprocess.CalledProcessError, IndexError, ValueError):
363+
# This is to check if ffmpeg is installed properly.
364+
subprocess.check_output(["ffmpeg", "-version"])
365+
except subprocess.CalledProcessError:
371366
print('Error fetching ffmpeg version, ignoring ffmpeg.')
372367
has_ffmpeg = False
373368

0 commit comments

Comments
 (0)