y5gfunc.source.source¶
source
¶
Functions:
| Name | Description |
|---|---|
wobbly_source |
Loads a video from a wobbly .wob project file. |
bestsource |
Loads a video source using bestsource (bs.VideoSource). |
load_source |
Bestsource and Wobbly wrapper to load a video source. |
load_dv_p7 |
Loads a Dolby Vision Profile 7 video file. |
wobbly_source
¶
wobbly_source(wob_project_path: Union[str, Path], timecodes_v2_path: Optional[Union[str, Path]] = None) -> VideoNode
Loads a video from a wobbly .wob project file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Union[str, Path]
|
Path to the .wob project file. |
required |
|
Optional[Union[str, Path]]
|
Optional path to a V2 timecodes file. |
None
|
Returns:
| Type | Description |
|---|---|
VideoNode
|
A VapourSynth VideoNode representing the processed video clip. |
Source code in y5gfunc/source/source.py
bestsource
¶
bestsource(file_path: Union[Path, str], track: int = 0, timecodes_v2_path: Optional[Union[Path, str]] = None, variableformat: int = -1, rff: bool = False) -> VideoNode
Loads a video source using bestsource (bs.VideoSource).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Union[Path, str]
|
Path to the video file. |
required |
|
int
|
Index of the video track to load. |
0
|
|
Optional[Union[Path, str]]
|
Path to a V2 timecodes file. |
None
|
|
int
|
See bestsource documentation. |
-1
|
|
bool
|
See bestsource documentation. |
False
|
Returns: A VapourSynth VideoNode loaded by bestsource.
Source code in y5gfunc/source/source.py
load_source
¶
load_source(file_path: Union[Path, str], track: int = 0, matrix: Optional[Matrix] = None, matrix_in: Optional[Matrix] = None, timecodes_v2_path: Optional[Union[Path, str]] = None) -> VideoNode
Bestsource and Wobbly wrapper to load a video source.
This function acts as a primary interface for loading video sources.
It checks the file extension:
- If it's a ".wob" file, it uses wobbly_source.
- Otherwise, it uses bestsource, attempting to automatically detect if the source uses RFF (Repeat First Field) based on frame counts.
After loading, it applies a color matrix conversion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Union[Path, str]
|
Path to the video file or .wob project file. |
required |
|
int
|
Index of the video track to load. Ignored for .wob files. |
0
|
|
Optional[Matrix]
|
Target color matrix. |
None
|
|
Optional[Matrix]
|
Input color matrix. |
None
|
|
Optional[Union[Path, str]]
|
Path to a V2 timecodes file. |
None
|
Returns:
| Type | Description |
|---|---|
VideoNode
|
A VapourSynth VideoNode representing the loaded and matrix-converted video clip. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the resolved |
AssertionError
|
If a |
Source code in y5gfunc/source/source.py
load_dv_p7
¶
load_dv_p7(file_path: Union[Path, str], bl_index: int = 0, el_index: int = 1, rpu_file_path: Optional[Union[Path, str]] = None) -> VideoNode
Loads a Dolby Vision Profile 7 video file.
This function incorporates workarounds for an underlying FFmpeg issue that causes source filters
(e.g., bestsource) to fail to extract the DolbyVisionRpu frame property from the last few
frames of a video. For more details, see: https://github.com/vapoursynth/bestsource/issues/97
Workarounds: 1. Default method (rpu_file_path=None): It uses FFMS2 to extract the RPU data from the video file. While convenient, this method has a significant caveat: FFMS2 might return stale RPU data for the final frames. Specifically, it carries over the RPU from the last valid frame even after seeking. This behavior is documented in the discussion of the linked issue.
- External RPU file (rpu_file_path is provided): This method uses an externally supplied RPU file. This is the most reliable workaround as it completely bypasses reliance on FFmpeg for RPU extraction. RPU data is required to be extracted into a file first using dovi_tool and then provided to this function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Union[Path, str]
|
Path to the video file. |
required |
|
int
|
Index of the Base Layer (BL) stream. |
0
|
|
int
|
Index of the Enhancement Layer (EL) stream. |
1
|
|
Optional[Union[Path, str]]
|
Optional path to the RPU file. |
None
|
Returns:
| Type | Description |
|---|---|
VideoNode
|
A VapourSynth VideoNode representing the Dolby Vision P7 video clip. |