Skip to content
Snippets Groups Projects
Commit 0e5c4a86 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Fix FFmpeg test in case FFmpeg was not available at compile time

parent e7c8c376
No related branches found
No related tags found
No related merge requests found
......@@ -98,14 +98,16 @@ def test_format_codecs():
distortions['mpeg2video']['color'] = 9.0
distortions['mpeg2video']['frameskip'] = 1.4
from .._externals import supported_videowriter_formats
SUPPORTED = supported_videowriter_formats()
for format in SUPPORTED:
for codec in SUPPORTED[format]['supported_codecs']:
for method in methods:
check_format_codec.description = "%s.test_%s_format_%s_codec_%s" % (__name__, method, format, codec)
distortion = distortions.get(codec, distortions['default'])[method]
yield check_format_codec, methods[method], shape, framerate, format, codec, distortion
from .._externals import versions
if versions['FFmpeg']['ffmpeg'] != 'unavailable':
from .._externals import supported_videowriter_formats
SUPPORTED = supported_videowriter_formats()
for format in SUPPORTED:
for codec in SUPPORTED[format]['supported_codecs']:
for method in methods:
check_format_codec.description = "%s.test_%s_format_%s_codec_%s" % (__name__, method, format, codec)
distortion = distortions.get(codec, distortions['default'])[method]
yield check_format_codec, methods[method], shape, framerate, format, codec, distortion
@testutils.ffmpeg_found()
def check_user_video(format, codec, maxdist):
......@@ -179,10 +181,12 @@ def test_user_video():
msmpeg4v2 = 2.3,
)
from .._externals import supported_videowriter_formats
SUPPORTED = supported_videowriter_formats()
for format in SUPPORTED:
for codec in SUPPORTED[format]['supported_codecs']:
check_user_video.description = "%s.test_user_video_format_%s_codec_%s" % (__name__, format, codec)
distortion = distortions.get(codec, distortions['default'])
yield check_user_video, format, codec, distortion
from .._externals import versions
if versions['FFmpeg']['ffmpeg'] != 'unavailable':
from .._externals import supported_videowriter_formats
SUPPORTED = supported_videowriter_formats()
for format in SUPPORTED:
for codec in SUPPORTED[format]['supported_codecs']:
check_user_video.description = "%s.test_user_video_format_%s_codec_%s" % (__name__, format, codec)
distortion = distortions.get(codec, distortions['default'])
yield check_user_video, format, codec, distortion
......@@ -71,6 +71,7 @@ def ffmpeg_version_lessthan(v):
indicated as a string parameter.'''
from .._externals import versions
if versions['FFmpeg']['ffmpeg'] == 'unavailable': return False
avcodec_inst= SV(versions['FFmpeg']['avcodec'])
avcodec_req = ffmpeg_versions[v][0]
return avcodec_inst < avcodec_req
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment