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.41.tar.gz
(27.1 kB
view hashes)
Built Distribution
Close
Hashes for videopython-0.1.41-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e005bca8603abec3b3b705dda56fc3d1825040932ef0badd829f8889b3bd064 |
|
MD5 | fe6ca46ac93066d4d48c216ef1a8afe5 |
|
BLAKE2b-256 | 351cd382a79b364920a8989299f66b03d0c4f72a2e5d3fbb18b7277f4f254d07 |