Frame-based cutting/trimming/splicing of audio with VapourSynth.
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, mkvmerge_path=, ffmpeg_path=, quiet=])
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,0)], afile)
Outputs:
-
If you have
ffmpeg
in your PATH or specify a path to an FFmpeg executable withffmpeg_path='/path/to/ffmpeg.exe'
, the script will automatically output a waveform audio file (.wav
) named/BDMV/STREAM/00003_cut.wav
. -
If not, the script will output a Mastroka Audio file (
.mka
) named/BDMV/STREAM/00003_cut.mka
.
MKV container example
import vapoursynth as vs
core = vs.core
from acsuite import eztrim
# no need to extract audio if using a container with a slice-able audio codec
file = r'/path/to/remuxed_bdmv.mkv' # Video: V_MPEG4/ISO/AVC, Audio: A_PCM/INT/LIT
# trimmed_clip = src[0:-22]
eztrim(core.lsmas.LWLibavSource(file), (0, -22), file, 'custom_name.mka')
Outputs:
-
If you have
ffmpeg
in your PATH or specify a path to an FFmpeg executable withffmpeg_path='/path/to/ffmpeg.exe'
, the script will automatically output a waveform audio file (.wav
) namedcustom_name.wav
in the directory the script is running from. -
If not, the script will output a Mastroka Audio file (
.mka
) namedcustom_name.mka
in the directory the script is running from.
Getting Started
Dependencies
Optional Dependencies
- FFmpeg - needed to output WAV files instead of Mastroka Audio (MKA)
Installing
Windows
- Navigate to your Python installation folder (i.e.
C:\Python\
). - Download the
acsuite.py
file to the site-packages folder (C:\Python\Lib\site-packages\
).
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.
Help!
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
File details
Details for the file acsuite-orangechannel-4.1.0.tar.gz
.
File metadata
- Download URL: acsuite-orangechannel-4.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfe6a26cb64aac04939917439f56bfb8b182593ad19b28f4d2de417105ac1c29 |
|
MD5 | 8e057b683a4d1443c3d8638a640d5158 |
|
BLAKE2b-256 | 4f2630d4263d069217547ddbfe043bb74533f35e9f73d44c9b399ff5930e6dd8 |
File details
Details for the file acsuite_orangechannel-4.1.0-py3-none-any.whl
.
File metadata
- Download URL: acsuite_orangechannel-4.1.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8364409557d3a6f4f55dfd38b6ef28476ac610088e48b0d500d5080b61bc6744 |
|
MD5 | 48735e6f0ad27bdf100832eb28ca0f78 |
|
BLAKE2b-256 | 948a61bdfdf840979f9e4c095f60c42d5c3edea69f707aa0aec75d25228d7028 |