subtitle-editor
Basic usage:
# Works with srt files
subtitle-editor video.mp4 subtitles.srt
# Can take plaintext files as input
subtitle-editor video.mp4 subtitles.srt --input lyrics.txt
See the Tutorial for details.
Setup (Mac OS)
Install dependencies
- Install Homebrew
- Install system dependencies (get a coffee while this runs)
brew install ffmpeg pyenv portaudio
- Finalize your pyenv installation For zsh (standard in newer Macs) this will be:
echo 'eval "$(pyenv init --path)"' >> ~/.zprofile echo 'eval "$(pyenv init -)"' >> ~/.zshrc
- Install python 3
pyenv install 3.7.11 # Or another python 3 version pyenv global 3.7.11
- Update pip (don't skip this)
pip install -U pip
Install subtitle-editor
pip install subtitle-editor
Tutorial: Add subtitles to a video
-
Create a plain text file that contains each subtitle on a separate line. Blank lines will be ignored. For example:
This is the first line This is the second line And so on
-
Import this file into subtitle-editor
cd /path/to/video/project subtitle-editor video.mp4 video.srt --input input.txt
The subtitle-editor will pre-render the frames of your video. Note: if video.srt already exists it will be overwritten.
-
Now you will create a rough cut of the subtitles. The idea here is to get your timestamps more or less right; you'll do a second pass to clean everything up later.
Type
Pto start playback, then press the spacebar to set the currently-selected timestamp and move to the next one. Keep going until you get to the end. -
Type
qto save your work and exit to the terminal.video.srtnow exists with your rough cut of subtitles! -
Run subtitle-editor again, but without passing an input. This will allow you to edit the existing subtitle file.
subtitle-editor video.mp4 video.srt
-
For each subtitle, type
pto play the video & audio for that subtitle. Use↑/↓/←/→to navigate between subtitles and start/end times. Use-/_and=/+to modify the times until they are correct. -
Navigate back to the beginning and type
Pto play back the whole video with subtitles. If there are any issues, typepto pause and make adjustments, then pressPto resume playback. -
Type
qto save your work and exit!
Command Reference
When you are using subtitle-editor, you have the following commands available.
Navigation
<tab>/←/→ Switch between start/end timestamps
↑/↓ Select a subtitle
=/+ Increase the selected timestamp by one frame / 1 sec
-/_ Decrease the selected timestamp by one frame / 1 sec
Playback
P Enter / leave playback mode
<space> In playback mode, set the current timestamp and move to the next one
u In playback mode, "undo" by moving back one timestamp (does not
actually undo the change)
p In standard mode, play the video between the start/end timestamps
of the current subtitle
Other
q Save and exit
Ctrl + c Exit without saving
? Display help message
Metadata
Release files for subtitle-editor 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| subtitle-editor-0.3.0.tar.gz | 25.1 kB | Without provenance | Details for subtitle-editor-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| subtitle_editor-0.3.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for subtitle_editor-0.3.0-py2.py3-none-any.whl |
Total release size: 49.6 kB
Release files / subtitle-editor-0.3.0.tar.gz
| Download URL | subtitle-editor-0.3.0.tar.gz |
|---|---|
| Size | 25.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a30a2cc5b4b56a7adfafb15af76a5f9bfaa94217cd756d66de32e500f3c5fd12
|
|
BLAKE2b-256 checksum How to use checksums |
de420412427ea9cb086473a387f00634d1ec2fb288b0b241841b842067788f8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.1 CPython/3.7.9
|
Release files / subtitle_editor-0.3.0-py2.py3-none-any.whl
| Download URL | subtitle_editor-0.3.0-py2.py3-none-any.whl |
|---|---|
| Size | 24.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c2f2a7498c86e0db3d7f68ec2f1667b4cef008cbbde2a8c7ffa342f27b92f861
|
|
BLAKE2b-256 checksum How to use checksums |
9e4eab219a96411ab4bb91220b65db4bc65be43bb2effb230ca50cfb748077c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.1 CPython/3.7.9
|
Security for subtitle-editor 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.