yukine.encoder_class¶
Module Contents¶
Classes¶
Class for encoding with chunked encoding |
Data¶
API¶
- yukine.encoder_class.script_dir =
None¶
- class yukine.encoder_class.Av1an(videos: list[yukine.vapoursynth_class.Source])¶
Initialization
Class for encoding with av1an
- static generate_scenes(file: pathlib.Path | None =
None, extra_split: int =240, encoder: yukine.vapoursynth_class.Encoder =Encoder.svt_av1, importer: yukine.vapoursynth_class.ImportMethod =ImportMethod.FFMS2, downscale_height: int =540, zones: pathlib.Path | None =None, encoder_settings: str | None =None, source: yukine.vapoursynth_class.Source | None =None) subprocess.CompletedProcess¶ Run av1an with the
--sc-onlyflag to generate the scenes fileyukine.scene_detect.SceneDetectcan be used to generate the scenes file as an alternative.- Parameters:¶
- file : Path | None¶
The file to generate scenes for. Defaults to None (use the file in
Sourceif provided)- extra_split : int¶
The extra split to use. Defaults to
240.- encoder : Encoder¶
The encoder to use. Defaults to
Encoder.svt_av1.- importer : ImportMethod¶
The importer to use. Defaults to
ImportMethod.FFMS2.- downscale_height : int¶
The downscale height to use. Defaults to
540.- zones : Path | None¶
The zones file to use. Defaults to
None.- source : Source | None¶
The
Sourceobject to use, sets and overrides the other arguments. Defaults toNone.
- static generate_scenes(file: pathlib.Path | None =
- class yukine.encoder_class.ChunkedEncoder(console: rich.console.Console)¶
Initialization
Class for doing chunked encoding, an alternative to av1an. Quite experimental, use at your own risk.
- encode(chunks: dict, encoder: yukine.vapoursynth_class.Encoder, encode_params: str, input_file: pathlib.Path, output_file: pathlib.Path, chunk_method: yukine.vapoursynth_class.ImportMethod, input_video: pathlib.Path | None =
None, temp_dir: pathlib.Path | None =None, max_concurrent: int =2, chunk_order: yukine.utils.ChunkOrder | str =ChunkOrder.long_to_short, custom_vspipe_info: dict ={}, resume: bool =False, keep: bool =False, photon_noise: int | None =None, photon_noise_width: int =1920, photon_noise_height: int =1080, chroma_noise: bool =False, hdr: bool =False) None¶ Run chunked encoding
- Parameters:¶
- chunks : dict¶
list of chunks from
SceneDetect.- encode_params : str¶
Encode parameters to use.
- output_file : Path¶
Output file.
- chunk_method : ImportMethod¶
Method to import chunks.
- input_video : Path | None¶
Input video file. Required if input_file is a vapoursynth script, so the script knows what to import.
- temp_dir : Path | None¶
temp directory. Defaults to None, in which case it will be generated based off the input file.
- max_concurrent : int¶
Maximum encoder instances to run at once. Defaults to 2.
- chunk_order : ChunkOrder | str¶
Order to encode chunks in. Defaults to
ChunkOrder.long_to_short.- custom_vspipe_info : dict¶
Custom vspipe information. Defaults to {}.
- resume : bool¶
Resume encoding from where it left off. Defaults to False.
- keep : bool¶
Keep temporary files. Defaults to False.
- photon_noise : int | None¶
ISO of grain table. Defaults to None.
- photon_noise_width : int¶
Width of the grain table. Defaults to 1920.
- photon_noise_height : int¶
Height of the grain table. Defaults to 1080.
- chroma_noise : bool¶
Whether to enable chroma grain. Defaults to False.
- hdr : bool¶
Whether the grain table is for HDR video. Defaults to False.
- encode(chunks: dict, encoder: yukine.vapoursynth_class.Encoder, encode_params: str, input_file: pathlib.Path, output_file: pathlib.Path, chunk_method: yukine.vapoursynth_class.ImportMethod, input_video: pathlib.Path | None =