Skip to main content

Minimal video generation and processing library.

Project description

About

Minimal video generation and processing library.

Setup

Install ffmpeg

# Install with brew for MacOS:
brew install ffmpeg
# Install with apt-get for Ubuntu:
sudo apt-get install ffmpeg

Install with pip

pip install videopython

Basic Usage

from videopython.base.video import Video
from videopython.base.transitions import FadeTransition

# Load video
video = Video.from_path("tests/test_data/fast_benchmark.mp4")
print(video.metadata)
print(video.frames.shape) # Video is based on numpy representation of frames

# Generate videos
video1 = Video.from_prompt("Dogs playing in the snow.")
video2 = Video.from_prompt("Dogs going back home.")

# Add videos
combined_video = video1 + video2
print(combined_video.metadata)

# Apply fade transition between videos
fade = FadeTransition(0.5) # 0.5s effect time
faded_video = fade.apply(videos=(video1, video2))
print(faded_video.metadata)

# Add audio from file
faded_video.add_audio_from_file("tests/test_data/test_audio.mp3")

# Save to a file
faded_video.save("my_video.mp4")

Running Unit Tests

PYTHONPATH=./src/ pytest

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

videopython-0.1.3.tar.gz (22.1 kB view hashes)

Uploaded Source

Built Distribution

videopython-0.1.3-py3-none-any.whl (20.8 kB view hashes)

Uploaded Python 3

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