Commit 149edb

2025-07-13 04:52:18 Tebby Dog: Added environment variables
2-code/docker/subway-surfers.md ..
@@ 1,15 1,10 @@
# 🚄 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)
-
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 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)
-
## 📸 Screenshot
![Generate](./Screenshot_2025-07-12_at_5.17.25_PM.png)
![Link](./Screenshot_2025-07-12_at_9.14.47_PM.png)
@@ 17,34 12,26 @@
![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)
-
-
## 🎯 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:
+ **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:
+ **Step 4:** Let's ride:
```sh
docker run -d --name subwaysurfers-text \
-v ./subwaysurfers/sources:/app/sources \
@@ 52,19 39,65 @@
-p 5000:5000 \
tebwritescode/subwaysurfers-text20:latest
```
-
**Step 5:** Fire up your browser and hit:
```
http://localhost:5000
```
-
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
+
+ # Where your Subway Surfers gameplay videos live
+ SOURCE_VIDEO_DIR=sources
+
+ # Pick a random source video each time?
+ # Set to "false" if you want to use a specific file (sources/myfile.mp4)
+ RANDOM_SOURCE=true
+
+ # How fast do you want that narration? (Default: 1)
+ # Higher = faster, lower = "I'm falling asleep here"
+ DEFAULT_SPEED=1
+ ```
+
+ Add them to your docker run command like a boss:
+
+ ```sh
+ docker run -d --name subwaysurfers-text \
+ -e MODEL_PATH=static/custom-model \
+ -e RANDOM_SOURCE=false \
+ -e SOURCE_VIDEO_DIR=sources/myfile.mp4 \
+ -e DEFAULT_SPEED=1.5 \
+ -v ./subwaysurfers/sources:/app/sources \
+ -v ./subwaysurfers/vosk-model-en-us-0.22:/app/static/vosk-model-en-us-0.22 \
+ -p 5000:5000 \
+ 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
+ - DEFAULT_SPEED=1.2
+ volumes:
+ - <HOSTPATH>/sources:/app/sources
+ - <HOSTPATH>/vosk-model-en-us-0.22:/app/static/vosk-model-en-us-0.22
+ ports:
+ - "5000:5000"
+ ```
+ ---
## 🛠 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:
@@ 75,46 108,32 @@
ports:
- "5000:5000"
```
-
Start it up:
```sh
docker-compose up -d
```
-
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
-
---
-
## 🔮 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
-
+ - ~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
---
-
## 🧠 Want to Run It Without Docker?
- You rebel. Here’s the repo for bare-metal installs:
+ You rebel. Here's the repo for bare-metal installs:
👉 https://github.com/tebwritescode/subwaysurfers-text-multi
-
---
-
## 🏆 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.
-
---
-
## ⚠️ 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 🚀
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