Skip to main content

Clips AI is an open-source Python library that automatically converts long videos into clips

Project description

ClipsAI

License: MIT

Quickstart

Clips AI is an open-source Python library that automatically converts long videos into clips. With just a few lines of code, you can segment a video into multiple clips and resize its aspect ratio from 16:9 to 9:16.

Note: Clips AI is designed for audio-centric, narrative-based videos such as podcasts, interviews, speeches, and sermons. It actively employs video transcripts to identify and create clips. Our resizing algorithm dynamically reframes and focuses on the current speaker, converting the video into various aspect ratios.

For full documentation, visit Clips AI Documentation. Check out a UI demo with clips generated by this library.

Installation

pip install clipsai
pip install whisperx@git+https://github.com/m-bain/whisperx.git

Creating clips

Clips are created based on the transcript of a video. You'll first need to transcribe the video, and then you can create clips based on the transcript. WhisperX is utilized under the hood to transcribe videos.

from clipsai import clip, transcribe

transcription = transcribe("video.mp4")
clips = clip(transcription)

print("StartTime: ", clips[0].start_time)
print("EndTime: ", clips[0].end_time)

Resizing a video

You'll need to create an access token on hugging face to resize a video because Pyannote is utilized for speaker diarization. You won't be charged for using Pyannote and instructions are on the Pyannote HuggingFace page.

from clipsai import resize

crops = resize(
    video_file_path="video.mp4",
    pyannote_auth_token="pyannote_token",
    aspect_ratio=(9, 16)
)

print("Crops: ", crops.segments)

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

clipsai-0.2.1.tar.gz (68.6 kB view details)

Uploaded Source

Built Distribution

clipsai-0.2.1-py3-none-any.whl (77.2 kB view details)

Uploaded Python 3

File details

Details for the file clipsai-0.2.1.tar.gz.

File metadata

  • Download URL: clipsai-0.2.1.tar.gz
  • Upload date:
  • Size: 68.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for clipsai-0.2.1.tar.gz
Algorithm Hash digest
SHA256 29f48275858ab8c4a73e3bc80cb285d3dcff5ffd297cb5af53ae2c3d2906157d
MD5 28bd5f218b552732674a99a3f8e0f6e3
BLAKE2b-256 934dfff41938430f8e80d7b5ae4ee0e040d0832a278650f2d7a8d67b4f2ef8cd

See more details on using hashes here.

File details

Details for the file clipsai-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: clipsai-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 77.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for clipsai-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f7693a3344353ef4808e80c15fbea39274ab67d4232ba73fac7d0e2226b6823
MD5 276678040799f4facc5f053e7bd8413a
BLAKE2b-256 f533718006389a4922fb5d015b4980bd4b0899f3d5575104b349c8822f84394e

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