diff --git a/xbob/io/test/test_video_codec.py b/xbob/io/test/test_video_codec.py index 116b9de175e923dc59dcb13162424b64ddbf7931..226f5a4e451afd098d0953eec78b0602e96f8058 100644 --- a/xbob/io/test/test_video_codec.py +++ b/xbob/io/test/test_video_codec.py @@ -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 diff --git a/xbob/io/test/utils.py b/xbob/io/test/utils.py index 5f72f91b8924fd7e8cb0fe7527619cddb3e401ef..0ec99af06948b4a207b63bda3492664f1f81190c 100644 --- a/xbob/io/test/utils.py +++ b/xbob/io/test/utils.py @@ -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