Commit 73e683

2025-08-18 11:20:52 Tebby Dog: updated readme
2-code/docker/subway-surfers.md ..
@@ 1,144 1,254 @@
- # 🚄 Subway Surfers Text-to-Video Converter
- Skip the fairy-tale, just give me the code already --> [Click Here](https://teb.codes/2-Code/Docker/Subway-Surfers#using-docker-compose-like-a-true-king)
+ # 🎮 Subway Surfers Text-to-Video Generator
+ > Behold: a Flask-powered monstrosity that slaps together gameplay footage, TikTok voices, and on-point captions—giving your boring text the glow-up it never knew it needed.
+ ![Version](https://img.shields.io/badge/Version-1.1.22-blue)
+ ![Python](https://img.shields.io/badge/Python-3.12-green)
+ ![Flask](https://img.shields.io/badge/Flask-3.0.3-blue)
+ ![Docker](https://img.shields.io/badge/Docker-Ready-blue)
+ ![License](https://img.shields.io/badge/License-MIT-yellow)
- Inspired by the absolute legend [danielbonkowsky/subwaysurfers-text](https://github.com/danielbonkowsky/subwaysurfers-text), this project throws some sauce on the original concept. If this container saves you time (or your sanity), go drop a star on his project already, damn it.
+ ## ⚡ What the Heck Is This?
+ Turn your articles—or your random stream-of-consciousness into short-form crack. With Subway Surfers gameplay. Because apparently, our brains now need dopamine and parkour to learn a damn thing. This app makes it fast, fun, and freakishly effective. Get that sweet virality hit.
- ## 🚀 What the Hell Is This?
- You ever try to focus on an article and your brain taps out after the second paragraph? Same. This little monster extracts text from a webpage and slaps it onto hyperactive **Subway Surfers** gameplay footage—turning dry, boring content into something your scrolling-addicted brain can actually sit through. Perfect for TikTok, ADHD, or just making studying suck less.
- You get:
- 🧠 smart content + 🎮 mindless gameplay = ✅ actual retention (probably)
+ ---
## 📸 Screenshots
- <details>
- <summary><i>Click to show screenshots</i></summary>
- ![Generate](./Screenshot_2025-07-12_at_5.17.25_PM.png)
- ![Link](./Screenshot_2025-07-12_at_9.14.47_PM.png)
- ![Progress Bar](./Screenshot_2025-07-12_at_9.11.06_PM.png)
- ![View Current 1](./Screenshot_2025-07-12_at_9.12.03_PM.png)
- ![View Current 2](./Screenshot_2025-07-12_at_5.17.41_PM.png)
- ![Browse](./Screenshot_2025-07-12_at_9.29.02_PM.png)
+ ## 🆕 Version 1.1.22 — We’re Not in Beta Anymore, Baby
+ 🏁 It’s production-ready, polished, and packs some serious features:
+ - ✅ WhisperASR joins the party for laser-accurate captions
+ - ✅ Will chew through long text like a pro—no irritating cutoffs
+ - ✅ Fine-tuned caption timing for when milliseconds matter
+ - ✅ Docker build now squeaky clean and snappy
+ - ✅ Wiped all temps and test outputs—Marie Kondo would be proud
+
+ ### 🚀 Previously on "Holy Hell, This App Got Stuff"
+ - ✅ Watch your video generate in real time like it's 1999
+ - ✅ Choose your favorite TikTok voice—Brian or bust
+ - ✅ Browse your masterpieces in-app like a proper social media producer
+ - ✅ Survives crashes like a cockroach in an apocalypse
- </details>
+ 📜 Wanna see the full changelog? It’s hanging out in [version.py](version.py).
- ## 🎯 Oh Hell Yeah, Features
- - Converts your average web article into a **Subway Surfers-screaming-TikTok-style video**
- - Rips text straight from URLs
- - Slaps it on top of fast-ass gameplay
- - Bonus points: **speech-to-text powered by Vosk API**
- - Built with **Flask + OpenCV + goose3 + Python + zero chill**
---
- ## 🐳 Running This Beast with Docker
- **Step 1:** Pull the image, because we're not building this crap from scratch:
- ```sh
- docker pull tebwritescode/subwaysurfers-text20:latest
- ```
- **Step 2:** Get the Vosk brain model and unzip it:
- ```sh
- wget https://alphacephei.com/vosk/models/vosk-model-en-us-0.22.zip
- unzip vosk-model-en-us-0.22.zip -d ./
- rm vosk-model-en-us-0.22.zip
- ```
- **Step 3:** Drop a gameplay video into `./sources` — any `.mp4` will do. More videos = more fun. Only one? It'll reuse that sucker on every run.
-
- **Step 4:** Let's ride:
- ```sh
- docker run -d --name subwaysurfers-text \
- -v ./subwaysurfers/sources:/app/sources \
- -v ./subwaysurfers/vosk-model-en-us-0.22:/app/static/vosk-model-en-us-0.22 \
- -p 5000:5000 \
+
+ ## ✨ Magical Powers (aka Features)
+ ### 🎬 Video Generation Wizardry
+ - Scrape the useful text from pages or input it directly
+ - Narration via TikTok’s vocal besties
+ - Subtitles locked in like clockwork—with tweakable timing
+ - Auto-looping gameplay on repeat while your message goes viral
+ - See every glorious progress bar along the way
+
+ ### 🎙️ Text-To-Speech Goodness
+ - TikTok voices so real, it’s uncanny
+ - Plays nice with long texts, even War and Peace levels
+ - Strip-clean text for pronunciation perfection
+ - Adjustable speed so you can go Morgan Freeman slow or auctioneer fast
+
+ ### 📱 Sleek, Sexy UI
+ - Modern, mobile-ready, and not hideous to look at
+ - Watch your progress *actually* progress
+ - Full-on video manager and preview
+ - Flash messages for feedback, because silence is for losers
+
+ ### 🔧 Under-the-Hood Insanity
+ - WhisperASR makes sure your captions don’t miss a beat
+ - Dockerified for painless deployment
+ - Configuration heaven (caption offsets, model paths, the works)
+ - Doesn’t crash when life gives you lemons
+
+ ---
+
+ ## 🚀 Quickstart: Make It Go Brrr
+ ### 🧙 You Will Need
+ - Python 3.12+ and pip (no dinosaurs allowed)
+ - FFmpeg (the secret sauce)
+ - OR Docker (the easy button)
+
+ ### Installation Path #1: Docker All the Damn Way (Recommended)
+ ```bash
+ docker run -p 5000:5000 \
+ -e WHISPER_ASR_URL=http://your-whisper-server:9000 \
+ -v /path/to/videos:/app/static \
tebwritescode/subwaysurfers-text20:latest
```
- **Step 5:** Fire up your browser and hit:
- ```
- http://localhost:5000
+
+ Or slap it up with Docker Compose:
+ ```bash
+ docker-compose up -d
```
- Get ready to weep tears of productivity as your article runs across a CGI train track.
- ---
- ## 🔧 Environment Variables For Control Freaks
- Want to make this thing dance to your tune? Here are the variables you can tweak:
- ```sh
- # Path to the Vosk TTS model
- MODEL_PATH=static/vosk-model-en-us-0.22
+ ### Installation Path #2: Do It Yourself, You Brave Nerd
+ ```bash
+ git clone https://github.com/tebwritescode/subwaysurfers-text-multi.git
+ cd subwaysurfers-text-multi
+ python3.12 -m venv .venv
+ source ./.venv/bin/activate
+ pip install -r requirements-pip.txt
+ ```
- # Where your Subway Surfers gameplay videos live
- SOURCE_VIDEO_DIR=sources
+ Now for the secret ingredients:
+ - 👂 Get the Vosk model:
+ https://alphacephei.com/vosk/models/vosk-model-en-us-0.22.zip
+ Unzip that sucker into `./static/vosk-model-en-us-0.22/`
+ - 🎮 Add background gameplay to `./static/` (grab a sample:
+ https://drive.google.com/file/d/1ZyFZKIB1HiZM_XDQPRRiiAIvU4sgl10k/view)
- # Pick a random source video each time?
- # Set to "false" if you want to use a specific file for SOURCE_VIDEO_DIR(sources/myfile.mp4)
- RANDOM_SOURCE=true
+ Fire. It. Up:
+ ```bash
+ python app.py
+ # Or the Flask way
+ flask run
```
- Add them to your docker run command like a boss:
+ Then slide into `http://localhost:5000` and get generating.
+
+ ---
+
+ ## 🛠️ Tweaky Settings (Because You’re Fancy)
+ | Name | Default | What It Does |
+ |------|---------|---------------|
+ | `FLASK_PORT` | 5000 | Port for your web wizardry |
+ | `WHISPER_ASR_URL` | http://localhost:9000 | Caption whisperer’s URL |
+ | `CAPTION_TIMING_OFFSET` | 0.25 | Controls how early/late your captions appear |
+ | `SOURCE_VIDEO_DIR` | ./static | Folder where your gaming chaos lives |
+ | `MODEL_PATH` | ./static/vosk-model-en-us-0.22 | Location of Vosk’s big brain |
+ | `DOCKER_ENV` | false | Flip to true when running in a container |
- ```sh
- docker run -d --name subwaysurfers-text \
- -e MODEL_PATH=static/custom-model \
- -e RANDOM_SOURCE=false \
- -e SOURCE_VIDEO_DIR=sources/myfile.mp4 \
- -v ./subwaysurfers/sources:/app/sources \
- -v ./subwaysurfers/vosk-model-en-us-0.22:/app/static/vosk-model-en-us-0.22 \
- -p 5000:5000 \
+ Quick Docker deploy reminder:
+ ```bash
+ docker run -p 5000:5000 \
+ -e WHISPER_ASR_URL=http://your-whisper-server:9000 \
+ -e CAPTION_TIMING_OFFSET=-0.1 \
+ -v /path/to/videos:/app/static \
tebwritescode/subwaysurfers-text20:latest
```
- Or in your docker-compose like a champion:
-
- ```yaml
- services:
- subwaysurfers-text:
- image: tebwritescode/subwaysurfers-text20:latest
- environment:
- - MODEL_PATH=static/vosk-model-en-us-0.22
- - SOURCE_VIDEO_DIR=sources
- - RANDOM_SOURCE=true
- volumes:
- - <HOSTPATH>/sources:/app/sources
- - <HOSTPATH>/vosk-model-en-us-0.22:/app/static/vosk-model-en-us-0.22
- ports:
- - "5000:5000"
+ ---
+
+ ## 📖 How to Wield the Power
+ ### Generate a Video, Baby
+ 1. Stroll over to the homepage
+ 2. Drop in your favorite copy-pasta, or slap in a URL
+ 3. Pick a voice (Jessie? Brian? Stitch? Go wild.)
+ 4. Adjust speech speed if you’re feeling fancy
+ 5. Click “Generate” and watch the sausage being made
+ 6. Download or stream the glorious final product
+
+ ### Voices You’ll Love or Hate
+ - Jessie — sassy, spunky, sounds like TikTok
+ - Brian — Very British. Probably drinks earl grey.
+ - Stitch — You already know he’s up to something.
+ - Echo — Narrates your life like it’s a gritty documentary.
+ - Oh, and more. Because OF COURSE there are more.
+
+ ### Hand-Picked Gameplay Backgrounds (aka: dopamine fuel)
+ - Subway Surfers
+ - Minecraft parkour (aka sweaty palms)
+ - Pokémon
+ - Factorio (factory go brrr)
+ - StarCraft battles
+ - Oddly satisfying slice clips
+
+ ---
+
+ ## 🏗️ How It All Stacks
+ ```
+ subwaysurfers-text-multi/
+ ├── app.py # Flask brainstem
+ ├── sub.py # Turns text into magic
+ ├── tiktokvoice.py # Talks like TikTok
+ ├── whisper_timestamper.py # Whisper those timestamps
+ ├── videomaker.py # Mashes video + captions
+ ├── cleantext.py # Makes your input less gross
+ ├── version.py # Keeps track of app’s many glow-ups
+ ├── requirements-pip.txt # Stuff Python needs
+ ├── requirements-docker.txt # Stuff Docker needs
+ ├── Dockerfile # Bottle it up
+ ├── docker-compose.yml # Auto-magic orchestration
+ ├── templates/ # HTML for humans
+ ├── static/ # Game videos and models
+ └── final_videos/ # Birthplace of brilliance
```
+
+ 💻 Tech Stack:
+ - Backend: Python 3.12, Flask
+ - TTS: Our buddy TikTok
+ - Speech: Vosk + Whisperlore
+ - Video: MoviePy, FFmpeg, OpenCV madness
+ - Frontend: HTML/CSS/JS that doesn’t suck
+ - Container: Yeah, Docker is here too
+
+ ---
+
+ ## 🔐 Don’t Worry, It’s Not Sketchy
+ - Input gets sanitized so trolls don’t win
+ - Malicious URLs? Denied at the gate
+ - Files renamed so they don’t nuke your machine
+ - Docker gives it adult supervision
+ - No login required—public chaos only
+
---
- ## 🛠 Using Docker Compose Like a True King 👑
- Replace `<HOSTPATH>` with the full path to where your god-tier video and Vosk model live.
- ```yaml
- services:
- subwaysurfers-text:
- image: tebwritescode/subwaysurfers-text20:latest
- volumes:
- - <HOSTPATH>/sources:/app/sources
- - <HOSTPATH>/vosk-model-en-us-0.22:/app/static/vosk-model-en-us-0.22
- ports:
- - "5000:5000"
+
+ ## 🛠️ For the Code-Wranglers
+ ### Test Everything Before You Wreck Everything
+ ```bash
+ python app.py --test
+ ./clean.sh # Delete past masterpieces
+ ./concat.sh # Process like a content farm
```
- Start it up:
- ```sh
- docker-compose up -d
+
+ ### Build the Docker Unicorn
+ ```bash
+ docker buildx build --platform linux/amd64,linux/arm64 \
+ -t tebwritescode/subwaysurfers-text20:latest \
+ -t tebwritescode/subwaysurfers-text20:v1.1.22 \
+ --push .
```
- Fun fact: if you only mount one `.mp4`, the app will always use that. Mount a folder of them? It picks a random vid each time. 🎲
+
---
- ## 🐍 The Dockerfile Straight-Up Breakdown
- - Uses a slimmed-down official Python image
- - Installs all the nasty dependencies (yes, even ffmpeg and build tools)
- - Brings in Homebrew in case you're feeling fancy
- - Copies the app, installs Python and brew packages
- - Runs Flask like it means it
- - Your container, your rules
+
+ ## 🐞 Known Bugs (We Keep It Real)
+ - Big videos = big wait times. Queue a snack.
+ - Weird characters might bamboozle the TTS
+ - Long articles can piss off your browser—keep it snack-sized
+ - WhisperASR server required if you actually want captions to line up
+
+ ---
+
+ ## 📊 Performance Stats
+ - 2-5 minutes per minute of final vid
+ - Eats up to 10,000 words like a champ
+ - Optimized for videos under 10 mins
+ - Section-splits large rants for smoother sailing
+
---
- ## 🔮 Shit I Still Wanna Add
- - Drop-down to select different AI voices (because not every AI wants to sound like Siri on Ambien)
- - ~NVIDIA GPU acceleration (because some of you have beefy rigs)~ Nixed this shit, GPU transcoding is slow AF
- - ~Fix that annoying subtitle-stuck bug nobody asked for~ I think I squashed this fucker
+
+ ## 🛣️ Roadmap (aka what’s cookin’)
+ - [ ] Delegate video crunching to its own nerdy container
+ - [ ] Let users pick their gameplay drug of choice
+ - [ ] Upload your own gameplay, you control freak
+ - [ ] More voice options (maybe Darth Vader?)
+ - [ ] Sneak peeks as the sausage gets stuffed
+ - [ ] Mass-processing for the content addicted
+
---
- ## 🧠 Want to Run It Without Docker?
- You rebel. Here's the repo for bare-metal installs:
- 👉 https://github.com/tebwritescode/subwaysurfers-text-multi
+
+ ## 🤝 Wanna Contribute? We Like You Already
+ 1. Fork it like it’s hot
+ 2. Branch out: `git checkout -b feature/amazing-feature`
+ 3. Test until it breaks
+ 4. Push your magic: `git push origin feature/amazing-feature`
+ 5. Make that Pull Request and show us what you got
+
---
- ## 🏆 Big-Ass Credit Section
- Massive props to [danielbonkowsky](https://github.com/danielbonkowsky/subwaysurfers-text) for the core idea. This is just a remixed, Dockerized, slightly louder sibling. Go say thanks.
+
+ ## 📝 License Stuff
+ MIT License. You’re free to do most things, just don’t sue us.
+
---
- ## ⚠️ Final Note from His Royal Freshness™
- Yeah, the container works. It does the job. But it's packing a little extra weight and could use a clean-up. If trimming containers gives you a tech boner, PRs are wide open.
- Enjoy learning like a hyper-caffeinated teenager on TikTok 🚀
+
+ 👑 Made with caffeine, chaos, and code by [tebbydog0605](https://github.com/tebbydog0605)
+ 📦 Docker Hub: [tebwritescode](https://hub.docker.com/u/tebwritescode)
+ 🌐 Website: [teb.codes](https://teb.codes)
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9