bvsfunc.util package¶
Submodules¶
bvsfunc.util.AudioProcessor module¶
-
bvsfunc.util.AudioProcessor.mpls_source(mpls_dict: str, trim_list: Union[List[Optional[int]], List[List[Optional[int]]]] = None, out_file: Optional[str] = None, out_dir: Optional[str] = None, trims_framerate: Optional[fractions.Fraction] = None, flac: bool = True, aac: bool = True, wav: bool = False, overwrite: bool = False, silent: bool = True)[source]¶ Processes audio from a given mpls file. Functions include trimming losslessly and encoding to flac and/or aac. Will concatonate the aligned audio streams when mpls defines multiple video files.
- Notes on trim_list:
Supports: single, multiple, empty ended, and negative trims.
Format: [[inclusive,exclusive],…].
- Examples:
trim_list = [100,500]
trim_list = [None,500]
trim_list = [100,None]
trim_list = [[None,500],[1000,2000],[100,None]]
trim_list = [-1000,None]
trim_list = [None,-24]
Note: Trims are absolute references to the source, not relative to each other.
- Parameters
mpls_dict ([type]) – The full filepath to the mpls file containing videos to process.
trim_list (list, optional) – A list or a list of lists of trims following python slice syntax, defaults to None.
trims_framerate (Fraction, optional) – Framerate of your source. Overrides automatic detection. If your source framerate is not the same as your output framerate, such as with interlaced sources, you Can be retrieved with core.fps(). Defaults to None.
out_dir (string) – A string path for the file output directory. Defaults the script file location. Requires the string format to be: r”path”
out_file (string) – A string prefix to name the output files with.
frames_total (int, optional) – The total number of frames in the clip before trimming. Useful for VFR, where this must be the total before any trimming. Otherwise, probably just leave it blank.
flac (bool, optional) – Enable FLAC encoding, defaults to True.
aac (bool, optional) – Enable AAC encoding, defaults to True.
wav (bool, optional) – Retain output of trimmed wav files, defaults to False.
overwrite (bool, optional) – Overwrite existing files (including wav) and forces re-extract and re-encode, deaults to False.
silent (bool, optional) – Silence eac3to, ffmpeg, flac, and qaac, defaults to True.
- Returns
A list of filepaths to all of the final processed files.
- Return type
-
bvsfunc.util.AudioProcessor.video_source(in_file: str, trim_list: Union[List[Optional[int]], List[List[Optional[int]]]] = None, out_file: Optional[str] = None, out_dir: Optional[str] = None, trims_framerate: Optional[fractions.Fraction] = None, frames_total: Optional[int] = None, flac: bool = True, aac: bool = True, wav: bool = False, overwrite: bool = False, silent: bool = True)[source]¶ Processes audio from a given video file. Functions include trimming losslessly and encoding to flac and/or aac.
- Notes on trim_list:
Supports: single, multiple, empty ended, and negative trims.
Format: [[inclusive,exclusive],…].
- Examples:
trim_list = [100,500]
trim_list = [None,500]
trim_list = [100,None]
trim_list = [[None,500],[1000,2000],[100,None]]
trim_list = [-1000,None]
trim_list = [None,-24]
Note: Trims are absolute references to the source, not relative to each other.
- Parameters
in_file (string) – The full filepath to the video file containing audio to process.
trim_list (list, optional) – A list or a list of lists of trims following python slice syntax, defaults to None.
trims_framerate (Fraction, optional) – Framerate of your source. Overrides automatic detection. If your source framerate is not the same as your output framerate, such as with interlaced sources, you Can be retrieved with core.fps(). Defaults to None.
out_dir (string) – A string path for the file output directory. Defaults the script file location. Requires the string format to be: r”path”
out_file (string) – A string prefix to name the output files with.
frames_total (int, optional) – The total number of frames in the clip before trimming. Useful for VFR, where this must be the total before any trimming. Otherwise, probably just leave it blank.
flac (bool, optional) – Enable FLAC encoding, defaults to True.
aac (bool, optional) – Enable AAC encoding, defaults to True.
wav (bool, optional) – Retain output of trimmed wav files, defaults to False.
overwrite (bool, optional) – Overwrite existing files (including wav) and forces re-extract and re-encode, deaults to False.
silent (bool, optional) – Silence eac3to, ffmpeg, flac, and qaac, defaults to True.
- Raises
SystemExit – Missing dependencies.
- Returns
A list of filepaths to all of the final processed files.
- Return type