Skip to content

Commit c44668e

Browse files
committed
Refactor: extract UI and Core modules, prep for PyInstaller build
1 parent da50e86 commit c44668e

19 files changed

Lines changed: 1789 additions & 606 deletions

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
*.srt
21
*.mp4
2+
*.mkv
3+
*.avi
4+
*.mov
5+
*.srt
36
*.csv
47
*.txt
8+
*.vat
9+
*.exe
510

611
# Ignore OS generated files
712
.DS_Store
@@ -32,3 +37,5 @@ Thumbs.db
3237
# Ignore backup files
3338
*.bak
3439
*.backup
40+
*.spec
41+
__pycache__/

README.md

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
11
# Video Annotation Tool
22

3-
A user-friendly tool for annotating video subtitles by selecting speakers and listeners.
3+
A subtitle-centric video annotation tool with an Aegisub-like layout, keyboard-first coding workflow, and CSV export.
44

55
## Features
66

7-
- **Subtitle Display:** Shows subtitles beneath the video.
8-
- **Character Selection:** Choose speakers and listeners from a list.
9-
- **Automatic Pausing:** Pauses at the end of each subtitle for annotation.
10-
- **Manual Control:** Use the space bar to play/pause the video.
11-
- **Save and Load:** Save progress anytime and load existing annotations.
12-
- **CSV Export:** Saves annotations in CSV with UTF-8 BOM for compatibility.
7+
- **Aegisub-like layout:** Video + coding panel on top, clickable subtitle list at the bottom.
8+
- **Split right panel:** Top area for character management, bottom area shows current Speaker/Listener/Target sets.
9+
- **Three-way coding:** Code Speaker, Listener, and Target per subtitle line.
10+
- **Keyboard-first workflow:**
11+
- `Space`: play/pause and continue line-by-line
12+
- `Up` / `Down`: previous / next subtitle line
13+
- `N`: jump to next uncoded subtitle line
14+
- `Left` / `Right`: rewind/forward 2 seconds
15+
- `Ctrl+F`: focus subtitle search box
16+
- `F1`: open shortcut help
17+
- `Ctrl+1 / 2 / 3`: set active coding role to Speaker / Listener / Target
18+
- `Ctrl+Q`: cycle active coding role
19+
- `Alt + key`: toggle character in active coding role
20+
- **Dynamic character management:** Add/remove/edit character names and shortcut bindings during annotation.
21+
- **Clickable subtitle list:** Click any row to jump to that line and restore its coding state.
22+
- **Subtitle filtering:** Search subtitle text and optionally show only uncoded lines.
23+
- **Status tracking:** Each subtitle row is marked as `Uncoded`, `Partial`, or `Done`.
24+
- **Editable Note column:** Fill per-line notes either from right panel Note input or directly in the table.
25+
- **Player controls:** Built-in play/pause button, timeline slider, and current/total time display.
26+
- **Coding template options:** Optional inheritance of Listener/Target from the previous line.
27+
- **Autosave + restore:** Periodic autosave with optional restore prompt on startup.
28+
- **Unsaved-change protection:** Save/discard/cancel prompt when closing.
29+
- **Safer writes:** Manual save and autosave use atomic write replacement to reduce data corruption risk.
30+
- **CSV import/export:** Save and load annotation progress in UTF-8 BOM CSV.
1331

1432
**Screen shot**
1533
![screenshot](./screenshot.png)
@@ -30,15 +48,39 @@ A user-friendly tool for annotating video subtitles by selecting speakers and li
3048

3149
1. **Run the Application**
3250
```
33-
python annotator.py
51+
python src/main.py
52+
```
53+
54+
If you are on Windows and get a Qt DLL load error in a Conda terminal, run with your system Python explicitly, for example:
55+
```
56+
c:/python313/python.exe src/main.py
3457
```
3558

3659
2. **Select Files**
37-
Select your video, srt, and txt files.
38-
The txt files should contain one character at each line.
60+
Select your video and SRT files. Character file is optional.
61+
If provided, each line can be:
62+
- `CharacterName`
63+
- `CharacterName,ShortcutKey`
3964

4065
3. **Start Annotation**
41-
Click "Start Annotation" to begin. The video will play and pause at each subtitle. Select speakers and listeners, then press the space bar to continue.
66+
Click "Start Annotation" to begin. The player auto-pauses at subtitle boundaries for coding.
67+
68+
4. **Manage Characters**
69+
Use the `Manage Characters & Shortcuts` button any time to edit names and bindings.
70+
71+
5. **Save Progress**
72+
- Manual save: `Ctrl+S`
73+
- Manual load: `Ctrl+O`
74+
- Autosave is performed periodically and can be restored automatically.
75+
76+
## Efficient Coding Workflow
77+
78+
1. Use `Up` / `Down` to move between subtitle lines.
79+
2. Use `Ctrl+1/2/3` or `Ctrl+Q` to choose the active coding role.
80+
3. Use `Alt + character key` to toggle characters into the active role.
81+
4. Turn on `Only show uncoded` to focus on remaining lines.
82+
5. Use `Inherit Listener/Target from previous line` to reduce repeated coding in dialogue runs.
83+
6. Use `N` (or `Next Uncoded` button) to jump through remaining work quickly.
4284

4385
## Contributing
4486

0 commit comments

Comments
 (0)