项目作者: D-K-E

项目描述 :
Trim video clips using audio threshold
高级语言: Python
项目地址: git://github.com/D-K-E/byeframe.git
创建时间: 2020-01-26T19:29:06Z
项目社区:https://github.com/D-K-E/byeframe

开源协议:MIT License

下载


byeframe

Trim video clips using audio threshold

Requirements

  • moviepy == 1.0: pip install moviepy==1.0

Basic Usage

python byeframe.py PATH_TO_VIDEO min_thres max_thresh thresh_duration

And you should obtain an output at the same folder of the input video
called out.mp4.

Here are the available options:

  1. usage: byeframe.py [-h] [--tmax TMAX] [--tdur TDUR] [--thread THREAD]
  2. [--splitNb SPLITNB]
  3. path
  4. positional arguments:
  5. path Path to video file [home/usr/foo.mp4]
  6. optional arguments:
  7. -h, --help show this help message and exit
  8. --tmax TMAX maximum threshold for sound [0.1 by default]
  9. --tdur TDUR duration in seconds for threshold for sound [0.05 by
  10. default]
  11. --thread THREAD use multiple thread [3 by default]
  12. --splitNb SPLITNB split video to nb parts. Necessary for large videos

For an efficient split pipeline, calculate each part as roughly about 10
seconds.

Dev Usage

Everything you need for trimming videos is in trim.py, if you’d like
to use it in an api. I use to have a minimum threshold as well to capture
volume ranges, but it did not serve a bunch, plus it was a little difficult
come up with a sensible default value, so I removed that from the
implementation.
However if you have such a need just add a min threshold value to the if
statement of cut_silence method of the SilenceTrimmer.