y5gfunc.encode.utils¶
utils
¶
Functions:
| Name | Description |
|---|---|
get_language_by_trackid |
Get the language code for a specific track ID within an M2TS file. |
get_language_by_trackid
¶
get_language_by_trackid(m2ts_path: Path, ffprobe_id: str) -> str
Get the language code for a specific track ID within an M2TS file.
Uses tsMuxeR to analyze the M2TS file and extract the language tag associated with the given track ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Path
|
Path to the M2TS file. |
required |
|
str
|
The track ID. Can be a hexadecimal string (e.g., '0x1011') or an integer representing the 0-based index from ffprobe. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The language code (e.g., "eng", "jpn") or "und" if not found or if tsMuxeR fails. |