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

Method _build_vtm_encode_cmd

gsplat/compression/video_codec.py:163–192  ·  view source on GitHub ↗

Builds the encoding command for VTM (EncoderApp).

(self, i_path: Path, o_path: Path, p: Dict[str, Any])

Source from the content-addressed store, hash-verified

161 return cmd
162
163 def _build_vtm_encode_cmd(self, i_path: Path, o_path: Path, p: Dict[str, Any]) -> List[str]:
164 """Builds the encoding command for VTM (EncoderApp)."""
165 for key in ['width', 'height', 'qp', 'pix_fmt', 'frame_num']:
166 if key not in p:
167 raise ValueError(f"Missing required parameter for VTM: '{key}'")
168
169 pix_fmt_map = {'yuv420p': '420', 'yuv422p': '422', 'yuv444p': '444', 'yuv400p': '400'}
170 chroma_format = pix_fmt_map.get(p['pix_fmt'])
171 if not chroma_format:
172 raise ValueError(f"Unsupported pix_fmt for VTM: {p['pix_fmt']}")
173
174 config_path = self.intra_lossy_config_path if p.get('use_all_intra') else self.inter_lossy_config_path
175
176 cmd = [
177 str(self.encoder_path),
178 '-c', config_path,
179 '-i', str(i_path),
180 '-b', str(o_path),
181 '-wdt', str(p['width']),
182 '-hgt', str(p['height']),
183 '-q', str(p['qp']),
184 '-cf', chroma_format,
185 '-fr', '30',
186 '-f', str(p['frame_num']),
187 ]
188 if p.get('all_intra', False):
189 cmd.extend(['-ip', '1'])
190 if 'extra_params' in p:
191 cmd.extend(p['extra_params'])
192 return cmd
193
194 def _build_hm_encode_cmd(self, i_path: Path, o_path: Path, p: Dict[str, Any]) -> List[str]:
195 """Builds the encoding command for HM (TAppEncoder)."""

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected