Skip to content

๐ŸŽฌ Web app to adjust SRT subtitle timings - full or partial shift with live preview. Privacy-focused, modern dark UI.

License

Notifications You must be signed in to change notification settings

DevWael/subtitle-shifter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฌ Subtitle Shifter

A modern web application to adjust SRT subtitle timings. Shift entire files or specific portions with an intuitive, privacy-focused interface, works on windows, linux and mac.

Node.js Express.js Tailwind CSS Docker License: MIT

โœจ Features

  • ๐Ÿš€ Full Shift - Adjust all subtitle timings at once
  • ๐ŸŽฏ Partial Shift - Shift only subtitles within a specific time range
  • ๐Ÿ‘๏ธ Live Preview - Compare original vs shifted timestamps before downloading
  • ๐ŸŒ™ Dark/Light Mode - Beautiful UI with theme persistence
  • ๐Ÿ”’ Privacy First - Files processed in-memory, never stored on server
  • ๐Ÿ“ฑ Responsive - Works on desktop, tablet, and mobile

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18.0 or higher
  • npm (comes with Node.js)

Installation

# Clone the repository
git clone https://github.com/DevWael/subtitle-shifter.git

# Navigate to the project
cd subtitle-shifter

# Install dependencies
npm install

# Start the server
npm start

Open http://localhost:3000 in your browser.

# Start server with auto-reload
npm run dev:server

# In another terminal, watch for CSS changes
npm run css:watch

๐Ÿณ Docker

The easiest way to run the app - no Node.js required!

# Clone the repository
git clone https://github.com/DevWael/subtitle-shifter.git
cd subtitle-shifter

# Run with Docker Compose
docker compose up -d

# Or build and run manually
docker build -t subtitle-shifter .
docker run -p 3000:3000 subtitle-shifter

Open http://localhost:3000 in your browser.

To stop: docker compose down

๐ŸŽฎ Usage

  1. Upload - Drag and drop an .srt file or click to browse
  2. Choose Mode
    • Full Shift: Adjust all subtitles
    • Partial Shift: Set a time range (e.g., 00:10:00 to 00:20:00)
  3. Set Offset - Enter milliseconds (positive = delay, negative = earlier)
  4. Preview - Review the changes with side-by-side comparison
  5. Download - Get your shifted subtitle file

Common Use Cases

Problem Solution
Subtitles appear 2 seconds early Set offset to +2000
Subtitles appear 500ms late Set offset to -500
Only half the movie is out of sync Use Partial Shift with time range

๐Ÿ› ๏ธ Tech Stack

  • Backend: Node.js, Express.js 4.x
  • Frontend: Vanilla JavaScript (ES6+)
  • Styling: Tailwind CSS 3.x
  • SRT Parsing: subtitle npm package
  • File Handling: Multer (memory storage)

๐Ÿ“ Project Structure

subtitle-shifter/
โ”œโ”€โ”€ server.js              # Express entry point
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ””โ”€โ”€ api.js         # REST API endpoints
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ””โ”€โ”€ srt-shifter.js # SRT parsing & shifting logic
โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ index.html         # Main page
โ”‚   โ”œโ”€โ”€ css/
โ”‚   โ”‚   โ”œโ”€โ”€ input.css      # Tailwind source
โ”‚   โ”‚   โ””โ”€โ”€ styles.css     # Compiled CSS
โ”‚   โ””โ”€โ”€ js/
โ”‚       โ””โ”€โ”€ app.js         # Frontend logic
โ””โ”€โ”€ test-files/
    โ””โ”€โ”€ sample.srt         # Sample file for testing

๐Ÿ”Œ API Endpoints

Method Endpoint Description
POST /api/upload Upload and parse SRT file
POST /api/shift Shift subtitles and get preview
POST /api/download Generate shifted SRT file

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments


Made with โค๏ธ by Ahmad Wael

About

๐ŸŽฌ Web app to adjust SRT subtitle timings - full or partial shift with live preview. Privacy-focused, modern dark UI.

Topics

Resources

License

Stars

Watchers

Forks