From 9a69c21accdd4f2975f9d7eecdf845178d4e2159 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 16 Jul 2014 10:12:04 +0200 Subject: [PATCH] validate:launcher: Generate proper EncodingProfiles for audio/video only media files --- validate/tools/launcher/apps/gst-validate.py | 2 +- validate/tools/launcher/utils.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/validate/tools/launcher/apps/gst-validate.py b/validate/tools/launcher/apps/gst-validate.py index d3448cee90..38103b9643 100644 --- a/validate/tools/launcher/apps/gst-validate.py +++ b/validate/tools/launcher/apps/gst-validate.py @@ -362,7 +362,7 @@ class GstValidateTranscodingTest(GstValidateTest): if urlparse.urlparse(self.dest_file).scheme == "": self.dest_file = path2url(self.dest_file) - profile = get_profile(self.combination) + profile = get_profile(self.combination, self.media_descriptor) self.add_arguments("-o", profile) def build_arguments(self): diff --git a/validate/tools/launcher/utils.py b/validate/tools/launcher/utils.py index 8c2fec83b9..ffe19de073 100644 --- a/validate/tools/launcher/utils.py +++ b/validate/tools/launcher/utils.py @@ -18,9 +18,9 @@ # Boston, MA 02110-1301, USA. """ Some utilies. """ -import sys import os import re +import sys import urllib import loggable import urlparse @@ -223,10 +223,19 @@ def get_profile_full(muxer, venc, aenc, video_restriction=None, return ret.replace("::", ":") -def get_profile(combination, video_restriction=None, audio_restriction=None): +def get_profile(combination, media_descriptor=None, video_restriction=None, audio_restriction=None): + vcaps = FORMATS[combination.vcodec] + acaps = FORMATS[combination.acodec] + if media_descriptor is not None: + if media_descriptor.get_num_tracks("video") == 0: + vcaps = None + + if media_descriptor.get_num_tracks("audio") == 0: + acaps = None + return get_profile_full(FORMATS[combination.container], - FORMATS[combination.vcodec], - FORMATS[combination.acodec], + vcaps, + acaps, video_restriction=video_restriction, audio_restriction=audio_restriction)