Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added warning message for unsupported ffmpeg version #4041

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import subprocess
import distutils.command.clean
import distutils.spawn
from distutils.version import StrictVersion
import glob
import shutil

Expand Down Expand Up @@ -346,6 +347,19 @@ def get_extensions():

ffmpeg_exe = distutils.spawn.find_executable('ffmpeg')
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]
if StrictVersion(ffmpeg_version) >= StrictVersion('4.3'):
print(f'ffmpeg {ffmpeg_version} not supported yet, please use ffmpeg 4.2.')
has_ffmpeg = False
except (IndexError, ValueError):
print('Error fetching ffmpeg version, ignoring ffmpeg.')
has_ffmpeg = False

print("FFmpeg found: {}".format(has_ffmpeg))

if has_ffmpeg:
Expand Down