|
1 | | -# CapCut SRT Generator (PHP + JS) |
2 | | -================================= |
3 | | - |
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 | | ---- |
12 | | - |
13 | | -📌 DESCRIPTION |
14 | | -------------- |
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 | | ---- |
18 | | - |
19 | | -✅ FEATURES |
20 | | ----------- |
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 | | ---- |
34 | | - |
35 | | -📸 INTERFACE SNAPSHOT |
| 1 | +CapCut SRT Generator (PHP + JS) |
| 2 | +=============================== |
| 3 | + |
| 4 | +Version: 1.3.0 |
| 5 | +Last Updated: May 2025 |
| 6 | +Author: Tarek Tarabichi |
| 7 | +License: MIT |
| 8 | + |
| 9 | +An open-source, browser-based tool to convert scripts into CapCut-compatible .srt subtitle files, optimized for voiceover and text-to-speech clarity. |
| 10 | + |
| 11 | +DESCRIPTION |
| 12 | +----------- |
| 13 | +CapCut SRT Generator allows content creators, editors, and educators to instantly transform written scripts into perfectly timed subtitle files. It splits your content into safe blocks, ensures clean speech flow, and avoids common pitfalls in auto-voiceovers. |
| 14 | + |
| 15 | +FEATURES |
| 16 | +-------- |
| 17 | +- Instant Subtitle Generation – Convert plain scripts into .srt format |
| 18 | +- CapCut Voiceover Compatibility – Auto-splits into 450-character blocks (max 500 safe) |
| 19 | +- Improved Sentence Flow – Breaks only on full stops (.) for natural voiceovers |
| 20 | +- Smart Cleanup – Strips markdown (###, ##, *, **) to prevent speech artifacts |
| 21 | +- Parameter Controls – Customize: |
| 22 | + • Words Per Second (WPS) |
| 23 | + • Minimum duration per block |
| 24 | + • Pause padding for punctuation |
| 25 | +- Copy & Download Options – Copy to clipboard or save .srt directly |
| 26 | +- Fixed Layout – Scrollable text area and preview box for consistent UI |
| 27 | +- Refresh Option – “New Script” button resets input instantly |
| 28 | + |
| 29 | +INSTALLATION & USAGE |
36 | 30 | --------------------- |
37 | | - |
38 | | - |
39 | | ---- |
40 | | - |
41 | | -🚀 HOW TO USE |
42 | | -------------- |
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: |
| 31 | +1. Clone or download the repository: |
| 32 | + git clone https://github.com/LebToki/ScriptGen.git |
46 | 33 |
|
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. |
| 34 | +2. Navigate to the directory: |
| 35 | + cd ScriptGen |
50 | 36 |
|
51 | | ---- |
| 37 | +3. Ensure PHP is installed (v7.4+ recommended) |
52 | 38 |
|
53 | | -🧱 FILE STRUCTURE |
54 | | ------------------ |
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 | | ---- |
60 | | - |
61 | | -🛠 TECH STACK |
62 | | ------------- |
63 | | -- PHP (no database) |
64 | | -- HTML5 + CSS (Flexbox layout) |
65 | | -- Vanilla JavaScript (Clipboard, Fetch API, File handling) |
| 39 | +4. Make the output folder writable: |
| 40 | + mkdir srt_files |
| 41 | + chmod 775 srt_files |
66 | 42 |
|
67 | | ---- |
| 43 | +5. Open index.php in your browser (e.g. http://localhost/ScriptGen/index.php) |
68 | 44 |
|
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 |
| 45 | +FILE STRUCTURE |
| 46 | +-------------- |
| 47 | +- index.php → Frontend with text input, preview, and controls |
| 48 | +- generate_srt.php → Backend PHP processor with cleaning + timing logic |
| 49 | +- /srt_files/ → Writable folder for generated .srt files |
76 | 50 |
|
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 |
| 51 | +TECH STACK |
85 | 52 | ---------- |
86 | | -- Auto line splitting and reflow for improved readability |
87 | | -- Speaker labels detection (e.g., “Narrator:”) |
88 | | -- Dark/Light mode toggle |
89 | | -- SRT validation for line length and time overlaps |
90 | | - |
91 | | ---- |
92 | | - |
93 | | -👨💻 CREDITS |
94 | | ------------- |
95 | | -Developed by **Tarek Tarabichi** |
| 53 | +- PHP (no database) |
| 54 | +- HTML/CSS (Responsive Flexbox) |
| 55 | +- JavaScript (Clipboard, Fetch API) |
| 56 | + |
| 57 | +VERSION HISTORY |
| 58 | +--------------- |
| 59 | +v1.3.0 – May 2025 |
| 60 | +- NEW: Splitting only at full stops (.) for smoother CapCut voiceovers |
| 61 | +- NEW: Markdown cleanup to remove symbols like ###, ##, * |
| 62 | +- Improved compatibility with text-to-speech readers |
| 63 | + |
| 64 | +v1.2.0 – Early May 2025 |
| 65 | +- CapCut voiceover block support (450 character chunks) |
| 66 | +- Added Copy Preview icon and New Script reset button |
| 67 | +- Scrollable, consistent layout |
| 68 | + |
| 69 | +v1.0.0 – Initial Release |
| 70 | +- SRT generation from script |
| 71 | +- Controls for timing (WPS, min duration, pause padding) |
| 72 | +- Live preview and download support |
| 73 | + |
| 74 | +ROADMAP |
| 75 | +------- |
| 76 | +- Speaker label handling (e.g., “Narrator:”) |
| 77 | +- Auto line-break reflow for readability |
| 78 | +- Light/Dark mode toggle |
| 79 | +- SRT validator (e.g., line length, time overlap) |
| 80 | + |
| 81 | +CREDITS |
| 82 | +------- |
| 83 | +Developed by Tarek Tarabichi |
96 | 84 | MIT License – Free to use, modify, and distribute |
97 | 85 |
|
98 | | ---- |
99 | | - |
100 | | -**Contribution Guidelines:** |
101 | | - |
102 | | -## 🤝 Contributing |
103 | | - |
104 | | -Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes. |
105 | | - |
106 | | -For major changes, please open an issue first to discuss what you would like to change. |
107 | | - |
108 | | ---- |
109 | | - |
110 | | -📬 FEEDBACK & CONTRIBUTIONS |
111 | | ---------------------------- |
112 | | -Found a bug or want to suggest a feature? |
113 | | -Open an issue or submit a pull request via GitHub. |
| 86 | +FEEDBACK & CONTRIBUTIONS |
| 87 | +------------------------- |
| 88 | +Found a bug or want to suggest a feature? |
| 89 | +Submit an issue or pull request at: |
| 90 | +https://github.com/LebToki/ScriptGen |
0 commit comments