MCPcopy Create free account
hub / github.com/JasonLSC/GSCodec_Studio / __init__

Method __init__

gsplat/compression/video_codec.py:54–79  ·  view source on GitHub ↗

Initializes the video codec wrapper. Args: video_codec_type: The type of video codec to use. encoder_path (optional): Path to the encoder executable. decoder_path (optional): Path to the decoder executable.

(self,
                 video_codec_type: Literal['vvenc', 'vtm', 'hm', 'ffmpeg'],
                 encoder_path: str = None,
                 decoder_path: str = None)

Source from the content-addressed store, hash-verified

52 """
53
54 def __init__(self,
55 video_codec_type: Literal['vvenc', 'vtm', 'hm', 'ffmpeg'],
56 encoder_path: str = None,
57 decoder_path: str = None):
58 """
59 Initializes the video codec wrapper.
60
61 Args:
62 video_codec_type: The type of video codec to use.
63 encoder_path (optional): Path to the encoder executable.
64 decoder_path (optional): Path to the decoder executable.
65 """
66 self.video_codec_type = video_codec_type.lower()
67 if self.video_codec_type not in VIDEO_CODEC_PATHS:
68 raise ValueError(f"Unsupported video codec type: {self.video_codec_type}. "
69 f"Supported types: {', '.join(VIDEO_CODEC_PATHS.keys())}")
70
71 codec_paths = VIDEO_CODEC_PATHS[self.video_codec_type]
72 self.encoder_path = Path(encoder_path or codec_paths['encoder'])
73 self.decoder_path = Path(decoder_path or codec_paths['decoder'])
74 self.intra_lossy_config_path = codec_paths.get('intra_lossy_config_path')
75 self.inter_lossy_config_path = codec_paths.get('inter_lossy_config_path')
76 self.intra_lossless_config_path = codec_paths.get('intra_lossless_config_path')
77 self.inter_lossless_config_path = codec_paths.get('inter_lossless_config_path')
78
79 self._check_executables()
80
81 def _check_executables(self):
82 """Ensures encoder and decoder executables exist and are accessible."""

Callers

nothing calls this directly

Calls 2

_check_executablesMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected