|
1 | 1 | # CapCut SRT Generator (PHP + JS) |
2 | | -=============================== |
| 2 | +================================= |
3 | 3 |
|
4 | | -An open-source, lightweight tool to convert plain text scripts into CapCut-compatible .SRT subtitle files with accurate timing and formatting. |
| 4 | +**Version:** 1.2.0 |
| 5 | +**Last Updated:** May 2025 |
| 6 | +**Author:** Tarek Tarabichi |
| 7 | +**License:** MIT |
| 8 | + |
| 9 | +An open-source, lightweight tool to convert plain text scripts into CapCut-compatible .SRT subtitle files with accurate timing, formatting, and voiceover compatibility. |
| 10 | + |
| 11 | +--- |
5 | 12 |
|
6 | 13 | 📌 DESCRIPTION |
7 | 14 | ------------- |
8 | | -This tool allows content creators, video editors, and storytellers to paste their script into a textbox, set timing parameters, and instantly generate subtitles for platforms like CapCut or Premiere Pro. |
| 15 | +This tool enables content creators, editors, and storytellers to convert any script into .srt subtitles formatted for CapCut and other video editors. It’s built for quick use—no installations, no database, just a clean UI and accurate subtitle timing. |
| 16 | + |
| 17 | +--- |
9 | 18 |
|
10 | 19 | ✅ FEATURES |
11 | 20 | ---------- |
12 | | -- Paste your script and generate .srt files instantly |
13 | | -- Adjust Words Per Second (WPS), Minimum Duration, and Pause Padding |
14 | | -- Copy subtitles or download the .srt file |
15 | | -- Clean and responsive 60/40 UI layout with live preview |
16 | | -- Fully runs in-browser with a PHP backend (no database required) |
| 21 | +- Paste your script and generate .srt subtitles instantly |
| 22 | +- Split text into blocks of ~450 characters for CapCut voiceover compatibility |
| 23 | +- Customize: |
| 24 | + - Words Per Second (WPS) |
| 25 | + - Minimum Duration per block |
| 26 | + - Pause Padding for punctuation |
| 27 | +- Copy SRT output or download the file |
| 28 | +- Fixed-height, scrollable preview and input to maintain layout |
| 29 | +- One-click reset to clear and reload interface |
| 30 | +- Fully runs in-browser with PHP backend |
| 31 | +- No external dependencies |
| 32 | + |
| 33 | +--- |
17 | 34 |
|
| 35 | +📸 INTERFACE SNAPSHOT |
| 36 | +--------------------- |
18 | 37 |  |
19 | 38 |
|
| 39 | +--- |
20 | 40 |
|
21 | 41 | 🚀 HOW TO USE |
22 | 42 | ------------- |
23 | | -1. Clone or download the repository to your localhost or web server. |
24 | | -2. Make sure you have PHP installed (PHP 7.4 or later recommended). |
25 | | -3. Ensure the `/srt_files/` folder exists and is writable: |
26 | | - - On Linux/Mac: |
27 | | - mkdir srt_files |
28 | | - chmod 775 srt_files |
29 | | -4. Open `index.php` in your browser via localhost (e.g. http://localhost/CapCut-SRT/index.php). |
30 | | -5. Paste your text, adjust timing, and click “Process” to preview subtitles. |
31 | | -6. Use the Copy or Download buttons to export your final .srt file. |
| 43 | +1. Clone or download the repository to your web server or localhost. |
| 44 | +2. Ensure PHP 7.4+ is installed and configured. |
| 45 | +3. Create a writable folder for SRT output: |
| 46 | + |
| 47 | +4. Open `index.php` in your browser (e.g. `http://localhost/CapCut-SRT/index.php`). |
| 48 | +5. Paste your script, tweak timing options, and click **Process**. |
| 49 | +6. Copy the result or download the `.srt` file. |
| 50 | + |
| 51 | +--- |
32 | 52 |
|
33 | 53 | 🧱 FILE STRUCTURE |
34 | 54 | ----------------- |
35 | | -- index.php → Main interface with input, preview, and controls |
36 | | -- generate_srt.php → PHP backend script that parses text and generates SRT |
37 | | -- /srt_files/ → Writable folder where .srt files are saved before download |
| 55 | +- `index.php` → Main UI with input box, preview, and controls |
| 56 | +- `generate_srt.php` → PHP backend to convert scripts to `.srt` |
| 57 | +- `/srt_files/` → Writable folder for temporary subtitle file storage |
| 58 | + |
| 59 | +--- |
38 | 60 |
|
39 | 61 | 🛠 TECH STACK |
40 | 62 | ------------ |
41 | | -- PHP (no database required) |
42 | | -- HTML/CSS (Flexbox layout) |
43 | | -- Vanilla JavaScript (Fetch API, clipboard, file generation) |
44 | | - |
45 | | -🎯 ROADMAP (Next Features) |
46 | | --------------------------- |
47 | | -- Auto line splitting for long lines |
48 | | -- Speaker label parsing (e.g. `Narrator:`) |
| 63 | +- PHP (no database) |
| 64 | +- HTML5 + CSS (Flexbox layout) |
| 65 | +- Vanilla JavaScript (Clipboard, Fetch API, File handling) |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +🧭 VERSION HISTORY |
| 70 | +------------------ |
| 71 | +**v1.2.0 – May 2025** |
| 72 | +- NEW: Split script into 450-character blocks (CapCut safe) |
| 73 | +- NEW: "Copy Preview" icon and "New Script" reset button |
| 74 | +- UI: Fixed-height scrollable text area and preview |
| 75 | +- Refactor: SRT logic based on character block duration, not just lines |
| 76 | + |
| 77 | +**v1.0.0 – Initial Release** |
| 78 | +- Core subtitle generation from raw script |
| 79 | +- Parameter controls for WPS, timing, and pauses |
| 80 | +- File download + live preview |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +🎯 ROADMAP |
| 85 | +---------- |
| 86 | +- Auto line splitting and reflow for improved readability |
| 87 | +- Speaker labels detection (e.g., “Narrator:”) |
49 | 88 | - Dark/Light mode toggle |
50 | | -- SRT structure validation (time overlaps, line length) |
| 89 | +- SRT validation for line length and time overlaps |
| 90 | + |
| 91 | +--- |
51 | 92 |
|
52 | 93 | 👨💻 CREDITS |
53 | 94 | ------------ |
54 | | -Developed by Tarek Tarabichi |
55 | | -MIT License – Free to use, modify, and distribute. |
| 95 | +Developed by **Tarek Tarabichi** |
| 96 | +MIT License – Free to use, modify, and distribute |
| 97 | + |
| 98 | +--- |
56 | 99 |
|
57 | 100 | 📬 FEEDBACK & CONTRIBUTIONS |
58 | 101 | --------------------------- |
59 | | -Found a bug? Have a feature idea? |
60 | | -Feel free to open an issue or submit a pull request via GitHub. |
| 102 | +Found a bug or want to suggest a feature? |
| 103 | +Open an issue or submit a pull request via GitHub. |
0 commit comments