Unverified Commit f88985b5 authored by Vincent Moens's avatar Vincent Moens Committed by GitHub
Browse files

ffmpeg version query (#4254)



* string manipulation for ffmpeg version retrieval

* ffmpeg version 4.2 control

* commenting solution

* removing all escapes for spaces
Co-authored-by: default avatarVincent Moens <vmoens@fb.com>
parent 7e987bfd
import os
import io
import re
import sys
from setuptools import setup, find_packages
from pkg_resources import parse_version, get_distribution, DistributionNotFound
......@@ -350,10 +351,10 @@ def get_extensions():
has_ffmpeg = ffmpeg_exe is not None
if has_ffmpeg:
try:
ffmpeg_version = subprocess.run(
'ffmpeg -version | head -n1', shell=True,
stdout=subprocess.PIPE).stdout.decode('utf-8')
ffmpeg_version = ffmpeg_version.split('version')[-1].split()[0]
# this splits on both dots and spaces as the output format differs across versions / platforms
ffmpeg_version_str = str(subprocess.check_output(["ffmpeg", "-version"]))
ffmpeg_version = re.split(r"ffmpeg version |\.| |-", ffmpeg_version_str)[1:3]
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
......
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