def decode(self, input_filepath: str, output_filepath: str, output_format: PixelFormat, timeout: int, verbose: bool) -> str: '''Decode the test vector and do the checksum''' pipeline = self.gen_pipeline(input_filepath, output_filepath, output_format) run_command(shlex.split(pipeline), timeout=timeout, verbose=verbose) return file_checksum(output_filepath)
def decode(self, input_filepath: str, output_filepath: str, output_format: PixelFormat, timeout: int, verbose: bool) -> str: '''Decodes input_filepath in output_filepath''' run_command([self.binary, '-b', input_filepath, '-o', output_filepath], timeout=timeout, verbose=verbose) return file_checksum(output_filepath)
def decode(self, input_filepath: str, output_filepath: str, output_format: PixelFormat, timeout: int, verbose: bool) -> str: '''Decodes input_filepath in output_filepath''' cmd = shlex.split(FFMPEG_TPL.format( self.cmd, input_filepath, str(output_format.value), output_filepath)) run_command(cmd, timeout=timeout, verbose=verbose) return file_checksum(output_filepath)
def check(self, verbose) -> bool: '''Check if GStreamer decoder is valid (better than gst-inspect)''' # pylint: disable=broad-except try: binary = normalize_binary_cmd(f'gst-launch-{self.gst_api}') pipeline = f'{binary} appsrc num-buffers=0 ! {self.decoder_bin} ! fakesink' run_command(shlex.split(pipeline), verbose=verbose) except Exception: return False return True
def decode(self, input_filepath: str, output_filepath: str, output_format: OutputFormat, timeout: int, verbose: bool) -> str: '''Decodes input_filepath in output_filepath''' # Addition of .pcm as extension is a must. If it is something else, e.g. ".out" the decoder will output a # ".wav", which is undesirable. output_filepath += ".pcm" run_command([self.binary, input_filepath, output_filepath], timeout=timeout, verbose=verbose) return file_checksum(output_filepath)
def decode( self, input_filepath: str, output_filepath: str, output_format: OutputFormat, timeout: int, verbose: bool, ) -> str: """Decodes input_filepath in output_filepath""" run_command( [self.binary, "--i420", input_filepath, "-o", output_filepath], timeout=timeout, verbose=verbose, ) return file_checksum(output_filepath)