Frame-based cutting/trimming/splicing of audio with VapourSynth and FFmpeg.
Project description
acsuite
audiocutter(.py) replacement for VapourSynth.
Allows for easy frame-based cutting/trimming/splicing of audio files using VapourSynth clip information.
Functions:
eztrim(clip, trims, audio_file[, outfile, ffmpeg_path=, quiet=, timecodes_file=])
import vapoursynth as vs
core = vs.core
from acsuite import eztrim
file = r'/BDMV/STREAM/00003.m2ts'
afile = r'/BDMV/STREAM/00003.wav' # pre-extracted with TSMuxer or similar
src = core.lsmas.LWLibavSource(file)
# for the example, we will assume the src clip is 100 frames long (0-99)
trimmed_clip = src[3:22]+src[23:40]+src[48]+src[50:-20]+src[-10:-5]+src[97:]
# `clip` arg should be the uncut/untrimmed source that you are trimming from
eztrim(src, [(3,22),(23,40),(48,49),(50,-20),(-10,-5),(97,None)], afile)
Output:
Uses the file extension of the input audio_file to output a cut/trimmed audio file with the same extension. If no outfile is given, defaults to audio_file_cut.ext
.
Utility Functions:
f2ts(f, src_clip=[, precision=, timecodes_file=])
Useful for finding the timestamp for a frame number.
from functools import partial
import vapoursynth as vs
core = vs.core
clip = core.std.BlankClip()
ts = partial(f2ts, src_clip=clip)
ts(5), ts(9), ts(clip.num_frames), ts(-1)
# ('00:00:00.208', '00:00:00.375', '00:00:10.000', '00:00:09.958')
clip_to_timecodes(src_clip)
Returns a list of timecodes for VFR clips. Used as a fallback when timecodes_file is not given to f2ts
or eztrim
.
Getting Started
Dependencies
Installing
Arch Linux
Install the AUR package vapoursynth-tools-acsuite-git
with your favorite AUR helper:
$ yay -S vapoursynth-tools-acsuite-git
Gentoo Linux
Install via the VapourSynth portage tree.
Windows / Other
Use the Python Package Index (PyPI / pip):
python3 -m pip install --user --upgrade acsuite-orangechannel
or simply
pip install acsuite-orangechannel
if you are able to use a pip
executable directly.
Help!
Check out the documentation or use Python's builtin help()
:
help('acsuite')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for acsuite-orangechannel-5.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 472f9f74902b197ddc1cffbb9d7a5769b33dc03a86d770bbf39f2a254dd050e1 |
|
MD5 | 5a49b50b59d702db4c240cc9d3129e4e |
|
BLAKE2b-256 | c98b2429b8a2874239dd8b68c34dff0b74952f479cbdec90c532a9685d21d6f4 |
Hashes for acsuite_orangechannel-5.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 108c397e463875797b7fc427fe3e5ef5c1198a1b8c1c22018262ed833de60ce0 |
|
MD5 | b405728a92dbef1704b5a51451cbc01d |
|
BLAKE2b-256 | 70d319c7d8bad4b07c24ed63b032042e03ad5be316fa3a8b406cd1693aeff962 |