Blame
|
1 | # 🚄 Subway Surfers Text-to-Video Converter |
||||||
| 2 | ||||||||
| 3 | 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) |
|||||||
| 4 | ||||||||
|
5 | 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. |
||||||
| 6 | ||||||||
| 7 | ## 🚀 What the Hell Is This? |
|||||||
| 8 | 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. |
|||||||
| 9 | ||||||||
| 10 | You get: |
|||||||
| 11 | 🧠 smart content + 🎮 mindless gameplay = ✅ actual retention (probably) |
|||||||
| 12 | ||||||||
|
13 | ## 📸 Screenshot |
||||||
|
14 |  |
||||||
| 15 |  |
|||||||
| 16 |  |
|||||||
| 17 |  |
|||||||
| 18 |  |
|||||||
| 19 |  |
|||||||
| 20 | ||||||||
|
21 | |||||||
| 22 | ## 🎯 Oh Hell Yeah, Features |
|||||||
| 23 | - Converts your average web article into a **Subway Surfers-screaming-TikTok-style video** |
|||||||
| 24 | - Rips text straight from URLs |
|||||||
| 25 | - Slaps it on top of fast-ass gameplay |
|||||||
| 26 | - Bonus points: **speech-to-text powered by Vosk API** |
|||||||
| 27 | - Built with **Flask + OpenCV + goose3 + Python + zero chill** |
|||||||
| 28 | ||||||||
| 29 | --- |
|||||||
| 30 | ||||||||
| 31 | ## 🐳 Running This Beast with Docker |
|||||||
| 32 | ||||||||
| 33 | **Step 1:** Pull the image, because we’re not building this crap from scratch: |
|||||||
| 34 | ```sh |
|||||||
| 35 | docker pull tebwritescode/subwaysurfers-text20:latest |
|||||||
| 36 | ``` |
|||||||
| 37 | ||||||||
| 38 | **Step 2:** Get the Vosk brain model and unzip it: |
|||||||
| 39 | ```sh |
|||||||
| 40 | wget https://alphacephei.com/vosk/models/vosk-model-en-us-0.22.zip |
|||||||
| 41 | unzip vosk-model-en-us-0.22.zip -d ./ |
|||||||
| 42 | rm vosk-model-en-us-0.22.zip |
|||||||
| 43 | ``` |
|||||||
| 44 | ||||||||
| 45 | **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. |
|||||||
| 46 | ||||||||
| 47 | **Step 4:** Let’s ride: |
|||||||
| 48 | ```sh |
|||||||
| 49 | docker run -d --name subwaysurfers-text \ |
|||||||
| 50 | -v ./subwaysurfers/sources:/app/sources \ |
|||||||
| 51 | -v ./subwaysurfers/vosk-model-en-us-0.22:/app/static/vosk-model-en-us-0.22 \ |
|||||||
| 52 | -p 5000:5000 \ |
|||||||
| 53 | tebwritescode/subwaysurfers-text20:latest |
|||||||
| 54 | ``` |
|||||||
| 55 | ||||||||
| 56 | **Step 5:** Fire up your browser and hit: |
|||||||
| 57 | ``` |
|||||||
| 58 | http://localhost:5000 |
|||||||
| 59 | ``` |
|||||||
| 60 | ||||||||
| 61 | Get ready to weep tears of productivity as your article runs across a CGI train track. |
|||||||
| 62 | ||||||||
| 63 | --- |
|||||||
| 64 | ||||||||
|
65 | ## 🛠 Using Docker Compose Like a True King 👑 |
||||||
|
66 | Replace `<HOSTPATH>` with the full path to where your god-tier video and Vosk model live. |
||||||
| 67 | ||||||||
| 68 | ```yaml |
|||||||
| 69 | services: |
|||||||
| 70 | subwaysurfers-text: |
|||||||
| 71 | image: tebwritescode/subwaysurfers-text20:latest |
|||||||
| 72 | volumes: |
|||||||
| 73 | - <HOSTPATH>/sources:/app/sources |
|||||||
| 74 | - <HOSTPATH>/vosk-model-en-us-0.22:/app/static/vosk-model-en-us-0.22 |
|||||||
| 75 | ports: |
|||||||
| 76 | - "5000:5000" |
|||||||
| 77 | ``` |
|||||||
| 78 | ||||||||
| 79 | Start it up: |
|||||||
| 80 | ```sh |
|||||||
| 81 | docker-compose up -d |
|||||||
| 82 | ``` |
|||||||
| 83 | ||||||||
| 84 | 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. 🎲 |
|||||||
| 85 | ||||||||
| 86 | --- |
|||||||
| 87 | ||||||||
| 88 | ## 🐍 The Dockerfile Straight-Up Breakdown |
|||||||
| 89 | ||||||||
| 90 | - Uses a slimmed-down official Python image |
|||||||
| 91 | - Installs all the nasty dependencies (yes, even ffmpeg and build tools) |
|||||||
| 92 | - Brings in Homebrew in case you're feeling fancy |
|||||||
| 93 | - Copies the app, installs Python and brew packages |
|||||||
| 94 | - Runs Flask like it means it |
|||||||
| 95 | - Your container, your rules |
|||||||
| 96 | ||||||||
| 97 | --- |
|||||||
| 98 | ||||||||
| 99 | ## 🔮 Shit I Still Wanna Add |
|||||||
| 100 | - Drop-down to select different AI voices (because not every AI wants to sound like Siri on Ambien) |
|||||||
|
101 | - ~~NVIDIA GPU acceleration (because some of you have beefy rigs)~~ Nixed this shit, GPU transcoding is slow AF |
||||||
| 102 | - ~~Fix that annoying subtitle-stuck bug nobody asked for~~ I think I squashed this fucker |
|||||||
|
103 | |||||||
| 104 | --- |
|||||||
| 105 | ||||||||
| 106 | ## 🧠 Want to Run It Without Docker? |
|||||||
| 107 | You rebel. Here’s the repo for bare-metal installs: |
|||||||
| 108 | 👉 https://github.com/tebwritescode/subwaysurfers-text-multi |
|||||||
| 109 | ||||||||
| 110 | --- |
|||||||
| 111 | ||||||||
| 112 | ## 🏆 Big-Ass Credit Section |
|||||||
| 113 | 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. |
|||||||
| 114 | ||||||||
| 115 | --- |
|||||||
| 116 | ||||||||
| 117 | ## ⚠️ Final Note from His Royal Freshness™ |
|||||||
| 118 | 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. |
|||||||
| 119 | ||||||||
| 120 | Enjoy learning like a hyper-caffeinated teenager on TikTok 🚀 |
|||||||