Skip to main content

Frame-based cutting/trimming/splicing of audio with VapourSynth and FFmpeg.

Project description

acsuite

Documentation Status

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

acsuite-orangechannel-5.4.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

acsuite_orangechannel-5.4.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file acsuite-orangechannel-5.4.1.tar.gz.

File metadata

  • Download URL: acsuite-orangechannel-5.4.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.5

File hashes

Hashes for acsuite-orangechannel-5.4.1.tar.gz
Algorithm Hash digest
SHA256 0650a7d0e8bfa4c0a266b44164e7856e8ec404d53ce5687d7ca3d4277124bd9c
MD5 0e1e4a9647b525eb3f471dee963c4af7
BLAKE2b-256 e21020f9b0f255d8ed3841188b1d51c1ce6307c4377d5a1ec69de094d11add2c

See more details on using hashes here.

File details

Details for the file acsuite_orangechannel-5.4.1-py3-none-any.whl.

File metadata

  • Download URL: acsuite_orangechannel-5.4.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.5

File hashes

Hashes for acsuite_orangechannel-5.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 487d977f118e38ef410e81aa0fb9d495858e6bf83e31679cff15a0637ebf9bcc
MD5 5395dd8f03529bfba0f6dd8778bad7bb
BLAKE2b-256 5bad5e95fe90be9b5e16f8cef30db824bf120fc89900e7741af6506b1365a375

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page