Awesome Open Source
Awesome Open Source

#+BEGIN_COMMENT SPDX-FileCopyrightText: 2019-2021 The subed Authors

SPDX-License-Identifier: GPL-3.0-or-later #+END_COMMENT

  • subed subed is an Emacs major mode for editing subtitles while playing the corresponding video with [[][mpv]]. At the moment, the only supported formats are SubRip ( .srt) and WebVTT ( .vtt ).


** Features

  • Quickly jump to next (M-n) and previous (M-p) subtitle text.
  • Quickly jump to the beginning (C-M-a) and end (C-M-e) of the current subtitle's text.
  • Insert subtitles evenly spaced throughout the available space (M-i) or right next the current subtitle (C-M-i). A prefix argument controls how many subtitles to insert and whether they are inserted before or after the current subtitle.
  • Kill subtitles (M-k).
  • Adjust subtitle start (M-[ / M-]) and stop (M-{ / M-}) time. A prefix argument sets the number of milliseconds for the current session (e.g. C-u 1000 M-[ M-[ M-[ decreases start time by 3 seconds).
  • Move the current subtitle or all marked subtitles forward (C-M-n) or backward (C-M-p) in time without changing subtitle duration. A prefix argument sets the number of milliseconds for the current session (e.g. C-u 500 C-M-n C-M-n moves the current subtitle 1 second forward).
  • Shift the current subtitle forward (C-M-f) or backward (C-M-b) together with all following subtitles. This is basically a convenience shortcut for C-SPC M-> C-M-n/p.
  • Sort and re-number subtitles and remove any extra spaces and newlines (M-s). This is done automatically every time the buffer is saved.

*** mpv integration (optional)

  • Open videos with C-c C-v or automatically when entering subed-mode if the video file is named like the subtitle file but with a video extension (e.g. .mkv or .avi).
  • Subtitles are automatically reloaded in mpv when the buffer is saved.
  • Cursor and playback position are synchronized:
    • Playback in mpv seeks to the position of the current subtitle as the cursor moves between subtitles (C-c ,).
    • The cursor is moved to the currently relevant subtitle as the video is playing (C-c .).
  • Copy the current playback position as start (C-c [) or stop (C-c ]) time of the current subtitle.
  • Playback is paused or slowed down when a subtitle's text is edited (C-c C-p).
  • Loop over the current subtitle in mpv (C-c C-l).
  • When a subtitle's start or stop time changes, mpv seeks to the subtitle's start time (C-c C-r).
  • Pause video playback without leaving Emacs (M-SPC).

** Installation For now, you have to install it manually. For example, copy subed/*.el to $HOME/.emacs.d/elisp/ and add $HOME/.emacs.d/elisp/ to your load-path.

#+BEGIN_SRC elisp (use-package subed ;; Tell emacs where to find subed :load-path "~/.emacs.d/elisp/" :config ;; Disable automatic movement of point by default (add-hook 'subed-mode-hook 'subed-disable-sync-point-to-player) ;; Remember cursor position between sessions (add-hook 'subed-mode-hook 'save-place-local-mode) ;; Break lines automatically while typing (add-hook 'subed-mode-hook 'turn-on-auto-fill) ;; Break lines at 40 characters (add-hook 'subed-mode-hook (lambda () (setq-local fill-column 40)))) #+END_SRC

C-h f subed-mode should get you started.

======= ** Contributions Contributions would be really appreciated! subed conforms to the [[][REUSE Specification]]; this means that every file has copyright and license information. If you modify a file, please update the year shown after SPDX-FileCopyrightText. Thank you!

There's a list of authors in the file If you have at any point contributed to subed, you are most welcome to add your name (and email address if you like) to the list.

** License subed is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [[][GNU General Public License]] for more details.

#+STARTUP: showeverything #+OPTIONS: num:nil #+OPTIONS: ^:{}

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
emacs-lisp (1,296
subtitles (42
srt (24
emacs-mode (17

Find Open Source By Browsing 7,000 Topics Across 59 Categories