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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for videopython-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37bfb80f66ab6691b54412d9db88699b5b1a667aa98b501a53934c0f7eba92dc |
|
MD5 | 0dafa8880f75a2feb921513b921c878a |
|
BLAKE2b-256 | 5d563302a6a69a493e04313a942f9db6efa5d0ca582083c7243697e71349cb2c |