Unverified Commit 9275cc61 authored by Prabhat Roy's avatar Prabhat Roy Committed by GitHub
Browse files

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
parent 3380c001
...@@ -360,14 +360,9 @@ def get_extensions(): ...@@ -360,14 +360,9 @@ def get_extensions():
has_ffmpeg = False has_ffmpeg = False
if has_ffmpeg: if has_ffmpeg:
try: try:
# this splits on both dots and spaces as the output format differs across versions / platforms # This is to check if ffmpeg is installed properly.
ffmpeg_version_str = str(subprocess.check_output(["ffmpeg", "-version"])) subprocess.check_output(["ffmpeg", "-version"])
ffmpeg_version = re.split(r"ffmpeg version |\.| |-", ffmpeg_version_str)[1:3] except subprocess.CalledProcessError:
ffmpeg_version = ".".join(ffmpeg_version)
if StrictVersion(ffmpeg_version) >= StrictVersion('4.3'):
print(f'ffmpeg {ffmpeg_version} not supported yet, please use ffmpeg 4.2.')
has_ffmpeg = False
except (subprocess.CalledProcessError, IndexError, ValueError):
print('Error fetching ffmpeg version, ignoring ffmpeg.') print('Error fetching ffmpeg version, ignoring ffmpeg.')
has_ffmpeg = False has_ffmpeg = False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment