An automated pipeline that generates and uploads engaging animated videos designed specifically for cats. Perfect for keeping your feline friends entertained!
Catflix uses Python and procedural animation to create hypnotic bug animations that capture cats' natural hunting instincts. The system can automatically generate videos and upload them to YouTube for a continuous stream of cat entertainment.
- 🐛 Procedural Animation: Generates random bug movements that mimic real prey behavior
- 🎬 Video Generation: Creates high-quality MP4 videos with sound effects
- 🤖 Automation: Can be scheduled to generate and upload videos automatically
- 🐱 Cat-Optimized: Designed based on what cats find most engaging
- 🎵 Audio Integration: Adds subtle sound effects to enhance engagement
- Python 3.8 or higher
- FFmpeg (for video generation)
- (Optional) YouTube API credentials for automatic uploads
-
Clone the repository:
git clone https://github.com/matt-ebrahim/catflix.git cd catflix -
Create conda environment:
conda env create -f environment.yml conda activate catflix
Or using pip:
pip install -r requirements.txt
-
Install FFmpeg:
- Windows: Download from ffmpeg.org
- Mac:
brew install ffmpeg - Linux:
sudo apt-get install ffmpeg
python video_generator.pyThis will create an animated video in the output/ directory.
You can customize the video generation by modifying parameters in video_generator.py:
# Video settings
VIDEO_WIDTH = 1920
VIDEO_HEIGHT = 1080
VIDEO_DURATION = 60 # seconds
FPS = 30
# Animation settings
NUM_BUGS = 5
BUG_SIZE = 20
SPEED_RANGE = (2, 8)To enable automatic YouTube uploads:
- Set up YouTube API credentials (see YouTube API Setup)
- Configure your credentials:
export YOUTUBE_CLIENT_ID="your-client-id" export YOUTUBE_CLIENT_SECRET="your-client-secret"
- Run with upload flag:
python video_generator.py --upload
catflix/
├── assets/ # Static assets (sounds, images)
├── output/ # Generated videos (gitignored)
├── video_generator.py # Main video generation script
├── environment.yml # Conda environment
├── requirements.txt # Pip requirements
└── README.md
- Bug Generation: Creates multiple "bugs" with random starting positions
- Movement Patterns: Each bug follows a semi-random path that mimics natural prey movement
- Video Rendering: Uses MoviePy to render smooth animations at 30 FPS
- Audio Mixing: Adds subtle sound effects to enhance the experience
- Export: Saves as high-quality MP4 file
Sample generated videos can be found in the examples/ directory.
Tested on multiple cats with positive results:
- ✅ Increased engagement time
- ✅ Natural hunting behaviors triggered
- ✅ Safe alternative to screen scratching
Contributions welcome! Ideas for improvements:
- Different animation patterns (fish, birds, lasers)
- More sound effect variations
- Machine learning to optimize based on cat engagement
- Integration with cat cameras for automatic playback
MIT License - feel free to use this to entertain your cats!
Created by Matt Ebrahim
Always supervise your cat when using screen-based entertainment. Ensure your screen is properly secured to prevent damage.
