Skip to content

Commit e80a385

Browse files
NicolasHugfacebook-github-bot
authored andcommitted
[fbsync] Enable building torchvision with ffmpeg regardless of version on Linux (#4413)
Summary: * Enable building torchvision with ffmpeg regardless of version on Linux * Skip tests with python 3.9 * Removed PY39_SKIP * Cleaned up a bit Reviewed By: datumbox Differential Revision: D31268050 fbshipit-source-id: b73ea0ab52e16b26a1e7b960833b5e345d545d3d
1 parent 377d9ef commit e80a385

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)