Anonymous committed 057c4a3

expose video pipeline options for debugging

Comments (0)

Files changed (2)


         return "codec_spec(%s)" % self.__dict__
     def __repr__(self):
-        return "codec_spec(%s)" % self.codec_class
+        try:
+            return "codec_spec(%s.%s)" % (self.codec_class.__module__, self.codec_class.__name__)
+        except:
+            return "codec_spec(%s)" % self.codec_class


         self._video_encoder = None
         self._lock = Lock()               #to ensure we serialize access to the encoder and its internals
+        self.last_pipeline_params = None
+        self.last_pipeline_scores = []
     def add_stats(self, info, suffix=""):
             vi = self._video_encoder.get_info()
             for k,v in vi.items():
                 info[prefix+"encoder."+k+suffix] = v
+        if self.last_pipeline_params:
+            encoding, width, height, src_format = self.last_pipeline_params
+            info[prefix+"pipeline_param.encoding"+suffix] = encoding
+            info[prefix+"pipeline_param.dimensions"+suffix] = width, height
+            info[prefix+"pipeline_param.src_format"+suffix] = src_format
+        if self.last_pipeline_scores:
+            i = 0
+            for score, csc_spec, enc_in_format, encoder_spec in self.last_pipeline_scores:
+                info[prefix+("pipeline_option[%s].score" % i)+suffix] = score 
+                info[prefix+("pipeline_option[%s].csc" % i)+suffix] = repr(csc_spec)
+                info[prefix+("pipeline_option[%s].format" % i)+suffix] = str(enc_in_format)
+                info[prefix+("pipeline_option[%s].encoder" % i)+suffix] = str(encoder_spec)
+                i += 1
     def cleanup(self):
         if self._video_encoder:
         #and make a new one:
-        scores = self.get_video_pipeline_options(encoding, width, height, src_format)
-        return self.setup_pipeline(scores, width, height, src_format)
+        self.last_pipeline_params = encoding, width, height, src_format
+        self.last_pipeline_scores = self.get_video_pipeline_options(encoding, width, height, src_format)
+        return self.setup_pipeline(self.last_pipeline_scores, width, height, src_format)
     def do_check_pipeline(self, encoding, width, height, src_format):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.