Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion fluster/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from abc import ABC, abstractmethod
from functools import lru_cache
from shutil import which
from typing import List, Optional, Type
from typing import Any, Dict, List, Optional, Type

from fluster.codec import Codec, OutputFormat
from fluster.utils import normalize_binary_cmd
Expand Down Expand Up @@ -47,6 +47,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath in output_filepath"""
raise Exception("Not implemented")
Expand Down
3 changes: 3 additions & 0 deletions fluster/decoders/ac4_decoder_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <https://www.gnu.org/licenses/>.

from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
from fluster.utils import file_checksum, run_command
Expand All @@ -38,6 +40,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath in output_filepath"""
run_command(
Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/av1_aom.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand All @@ -38,6 +39,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath in output_filepath"""
fmt = "--rawvideo"
Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/av1_dav1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand All @@ -37,6 +38,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath in output_filepath"""
fmt = "yuv"
Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/chromium.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# License along with this library. If not, see <https://www.gnu.org/licenses/>.

from functools import lru_cache
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand Down Expand Up @@ -50,6 +51,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
return str(main(input_filepath))

Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/cros_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand All @@ -38,6 +39,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath in output_filepath"""

Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand All @@ -36,5 +37,6 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
return file_checksum(input_filepath)
3 changes: 2 additions & 1 deletion fluster/decoders/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import re
import subprocess
from functools import lru_cache
from typing import Dict, Optional, Tuple
from typing import Any, Dict, Optional, Tuple

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand Down Expand Up @@ -70,6 +70,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath in output_filepath"""
command = [self.binary, "-hide_banner", "-nostdin"]
Expand Down
9 changes: 7 additions & 2 deletions fluster/decoders/gstreamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import shlex
import subprocess
from functools import lru_cache
from typing import List, Optional, Tuple
from typing import Any, Dict, List, Optional, Tuple

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand Down Expand Up @@ -134,9 +134,11 @@ def gen_pipeline(
input_filepath: str,
output_filepath: Optional[str],
output_format: OutputFormat,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Generate the GStreamer pipeline used to decode the test vector"""
output = f"location={output_filepath}" if output_filepath else ""

return PIPELINE_TPL.format(
self.cmd,
input_filepath,
Expand Down Expand Up @@ -177,6 +179,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decode the test vector and do the checksum"""
# When using videocodectestsink we can avoid writing files to disk
Expand All @@ -190,7 +193,7 @@ def decode(
data = run_command_with_output(command, timeout=timeout, verbose=verbose).splitlines()
return self.parse_videocodectestsink_md5sum(data)

pipeline = self.gen_pipeline(input_filepath, output_filepath, output_format)
pipeline = self.gen_pipeline(input_filepath, output_filepath, output_format, optional_params)
run_command(shlex.split(pipeline), timeout=timeout, verbose=verbose)
return file_checksum(output_filepath)

Expand Down Expand Up @@ -232,6 +235,7 @@ def gen_pipeline(
input_filepath: str,
output_filepath: Optional[str],
output_format: OutputFormat,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
raw_caps = "video/x-raw"
try:
Expand Down Expand Up @@ -835,6 +839,7 @@ class FluendoVVCdeCH266Decoder(GStreamerVideo):
decoder_bin = " fluh266dec "
provider = "Fluendo"
api = "SW"

parser = "h266parse " if gst_element_exists("h266parse") else "fluh266parse"


Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/h264_jct_vt.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand All @@ -38,6 +39,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath in output_filepath"""
run_command(
Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/h265_jct_vt.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand All @@ -38,6 +39,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath in output_filepath"""
run_command(
Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/h266_vvc_vtm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand All @@ -37,6 +38,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath in output_filepath"""
# pylint: disable=unused-argument
Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/h266_vvdec.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand All @@ -37,6 +38,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath in output_filepath"""
run_command(
Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/iso_mpeg2_aac.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
import glob
import os
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand All @@ -40,6 +41,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> 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
Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/iso_mpeg2_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import glob
import os
import tempfile
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand All @@ -41,6 +42,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath in output_filepath"""
with tempfile.TemporaryDirectory() as temp_dir:
Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/iso_mpeg4_aac.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# License along with this library. If not, see <https://www.gnu.org/licenses/>.

import glob
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand All @@ -40,6 +41,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> 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
Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/iso_mpeg4_aac_er.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# License along with this library. If not, see <https://www.gnu.org/licenses/>.

import glob
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand All @@ -40,6 +41,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath in output_filepath"""
output_filepath += ".raw"
Expand Down
3 changes: 2 additions & 1 deletion fluster/decoders/iso_mpeg4_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
import os
import subprocess
from typing import Tuple
from typing import Any, Dict, Optional, Tuple

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand All @@ -41,6 +41,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath to output_filepath"""
width, height = self._get_video_resolution(input_filepath, verbose)
Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/libvpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand Down Expand Up @@ -42,6 +43,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath in output_filepath"""
fmt = None
Expand Down
2 changes: 2 additions & 0 deletions fluster/decoders/vk_video_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
from typing import Any, Dict, Optional

from fluster.codec import Codec, OutputFormat
from fluster.decoder import Decoder, register_decoder
Expand All @@ -38,6 +39,7 @@ def decode(
timeout: int,
verbose: bool,
keep_files: bool,
optional_params: Optional[Dict[str, Any]] = None,
) -> str:
"""Decodes input_filepath in output_filepath"""
codec_mapping = {
Expand Down
1 change: 1 addition & 0 deletions fluster/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def _execute_decode(self) -> str:
self.timeout,
self.verbose,
keep_files_for_decode,
self.test_vector.optional_params,
)

def _cleanup_if_needed(self) -> None:
Expand Down
Loading