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[generation]
You can install without
[generation]
dependencies for basic video handling and processing. The funcionalities found invideopython.generation
won't work.
Basic Usage
Using Nvidia A40 or better is recommended for the
videopython.generation
module.
# Generate image and animate it
from videopython.generation import ImageToVideo
from videopython.generation import TextToImage
image = TextToImage().generate_image(prompt="Golden Retriever playing in the park")
video = ImageToVideo().generate_video(image=image, fps=24)
# Video generation directly from prompt
from videopython.generation import TextToVideo
video_gen = TextToVideo()
video = video_gen.generate_video("Dogs playing in the snow")
for _ in range(10):
video += video_gen.generate_video("Dogs playing in the snow")
# Cut the first 2 seconds
from videopython.base.transforms import CutSeconds
transformed_video = CutSeconds(start_second=0, end_second=2).apply(video.copy())
# Upsample to 30 FPS
from videopython.base.transforms import ResampleFPS
transformed_video = ResampleFPS(new_fps=30).apply(transformed_video)
# Resize to 1000x1000
from videopython.base.transforms import Resize
transformed_video = Resize(width=1000, height=1000).apply(transformed_video)
filepath = transformed_video.save()
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.4.tar.gz
(27.0 kB
view hashes)
Built Distribution
Close
Hashes for videopython-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97eb7e54febd567481b9cc207a9345e10a0132f31230301165a4c9361879085a |
|
MD5 | 32758d80c09b872eb95ff79e3b2ae631 |
|
BLAKE2b-256 | dd1b4b738fb1f750bc83a0d7db258b5d1512dafabaa29fa08b2250228e9defc5 |