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.1.tar.gz
(20.1 kB
view hashes)
Built Distribution
Close
Hashes for videopython-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ece0d3a70e7f16009db3541ed9624736c97c3dfe32cf1a92c95da3e213e4981 |
|
MD5 | 273f8ac9a84c3970ef340a9e9b74caa1 |
|
BLAKE2b-256 | c65127d42d20669bef0c95cd31fd12dbf38c9620bb64e1742f6cb70ebf0e47dd |