Skip to main content

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)

Metadata

Release files for clipsai 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clipsai 0.2.1
File Size Uploaded
clipsai-0.2.1.tar.gz 68.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clipsai 0.2.1
File Interpreter ABI Platform
clipsai-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 145.8 kB

Release files / clipsai-0.2.1.tar.gz

Download URL clipsai-0.2.1.tar.gz
Size 68.6 kB
Tags Source
SHA-256 checksum
How to use checksums
29f48275858ab8c4a73e3bc80cb285d3dcff5ffd297cb5af53ae2c3d2906157d
BLAKE2b-256 checksum
How to use checksums
934dfff41938430f8e80d7b5ae4ee0e040d0832a278650f2d7a8d67b4f2ef8cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / clipsai-0.2.1-py3-none-any.whl

Download URL clipsai-0.2.1-py3-none-any.whl
Size 77.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f7693a3344353ef4808e80c15fbea39274ab67d4232ba73fac7d0e2226b6823
BLAKE2b-256 checksum
How to use checksums
f533718006389a4922fb5d015b4980bd4b0899f3d5575104b349c8822f84394e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page