You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Run `install.bat` (for Windows) or `install.sh` (for GNU/Linux or macOS). This automatically installs dependencies listed in `requirements.txt` into a Python virtual environment.
35
35
3.*(For Extra Job `ocr` only, not required for basic timeline generation)* Install Tesseract OCR v5.3.3.20231005 (or above).
36
36
@@ -41,7 +41,7 @@ Currently, only win_amd64 is supported. No Python installation is needed. You ca
41
41
For beginners, the following settings are recommended:
42
42
43
43
- Specify the input video file in the `source` section.
44
-
- Set `strategy` to `bcs` and `preset` to `default`. This should already be the default.
44
+
- Set `strategy` to `dtd` and `preset` to `default`. This should already be the default.
45
45
- Set `engine` to `speculative`. This should also be the default.
46
46
47
47
**Debug Running**: Run in debug mode to check whether the subtitle area is included in the detection window.
@@ -51,7 +51,7 @@ Temporarily make these changes to `config.yml`:
51
51
- Set `engine` to `framewise`.
52
52
- Under the `framewise` section, set `debug` to `true` (this is the default).
53
53
54
-
Then, run `MagiaTimeline.bat`/`MagiaTimeline.exe` (Windows) or `MagiaTimeline.sh` (GNU/Linux or macOS). A window will pop up showing the frames from your video with a red box at the bottom. The red box should cover the area where the subtitles appear. If it does not, adjust `dialogRect` under the `bcs`, `default` section and rerun. You don’t need to run the entire program in debug mode—quit by typing `q` in the display window whenever you’re done checking.
54
+
Then, run `MagiaTimeline.bat`/`MagiaTimeline.exe` (Windows) or `MagiaTimeline.sh` (GNU/Linux or macOS). A window will pop up showing the frames from your video with a red box at the bottom. The red box should cover the area where the subtitles appear. If it does not, adjust `dialogRect` under the `dtd`, `default` section and rerun. You don’t need to run the entire program in debug mode—quit by typing `q` in the display window whenever you’re done checking.
55
55
56
56
If the video’s resolution is too high for the display window, consider adjusting `debugPyrDown` under the `framewise` section.
57
57
@@ -63,9 +63,10 @@ If the video’s resolution is too high for the display window, consider adjusti
63
63
64
64
A *Strategy* is a set of CV algorithms that tells the framework how to identify subtitles in a frame. You can choose which Strategy to use for your video.
65
65
66
-
MagiaTimeline provides two recommended general-purpose Strategies:
66
+
MagiaTimeline provides three recommended general-purpose Strategies:
67
67
68
-
-**Box colour stat (`bcs`)**: A CV pipeline consisting of ML-based text detection, color statistics, and feature extraction. This strategy works for most videos without tuning and is the top recommendation.
68
+
-**Diff text detection (`dtd`)**: Finds text changes by performing ML-based text detection on the difference of two frames. This strategy works for most videos without tuning and is the top recommendation.
69
+
-**Box colour stat (`bcs`)**: Performs colour statistics on regions boxed by ML-based text detection to find out text changes. This is a backup choice if `dtd` does not work.
69
70
-**Outline (`otl`)**: A CV pipeline that relies on predefined parameters for text and outline color and weight to detect subtitles. It is much faster than `bcs` in applicable cases, but it requires manual parameter adjustments.
70
71
71
72
Traditionally, there are also Strategies specialized for certain types of videos. These are fast and accurate but not generalizable:
@@ -81,21 +82,15 @@ Traditionally, there are also Strategies specialized for certain types of videos
81
82
An *Engine* determines how frames are sampled before they are processed by Strategies. MagiaTimeline provides two Engines:
82
83
83
84
-**Framewise**: Processes every frame (or every n-th frame, where n is configurable) to form a linear string of features before connecting them as subtitle intervals. This engine is slow but supports all Strategies. In debug mode, it provides a visual window showing the currently processed frame, useful for debugging and tuning parameters.
84
-
-**Speculative**: Processes fewer frames by skipping those unlikely to contain subtitle changes. This engine is about 20× faster than the Framewise engine but only supports the `bcs` and `otl` general-purpose strategies.
85
+
-**Speculative**: Processes fewer frames by skipping those unlikely to contain subtitle changes. This engine is about 20× faster than the Framewise engine but only supports the `dtd`, `bcs` and `otl` general-purpose strategies.
85
86
86
87
## Troubleshooting
87
88
88
89
### Enabling Entire-Frame Detection
89
90
90
-
By default, the `bcs`strategy only detects subtitles in the bottom quarter of the screen (`dialogRect` starts at `0.75`). This is because the upper part of the screen often contains text or other content that may interfere with subtitle detection.
91
+
By default, the `dtd` and `bcs`strategies only detects subtitles in the bottom quarter of the screen (`dialogRect` starts at `0.75`). This is because the upper part of the screen often contains text or other content that may interfere with subtitle detection.
91
92
92
-
If your video has subtitles above this region and you need full-screen detection, open `config.yml`. Under the `bcs:` → `default:` section, locate the `dialogRect:` parameter and change the `0.75` to `0.00`. This allows subtitle detection across the entire frame.
93
-
94
-
### Black-and-White Subtitles
95
-
96
-
If your video features black-and-white (or gray) subtitles, you may find the `bcs` strategy difficult to detect them. MagiaTimeline assigns a lower priority to pure grayscale colors (black/white/gray), which helps reduce false positives but can interfere with accurately picking up purely black-and-white subtitles.
97
-
98
-
To improve black-and-white subtitle detection, open `config.yml` and go to `bcs:` → `default:`. Find `maxGreyscalePenalty: 0.70` and change it to `0.00`. This removes the penalty for grayscale pixels and may significantly improve the recognition of black-and-white subtitles.
93
+
If your video has subtitles above this region and you need full-screen detection, open `config.yml`. Under the `dtd:` (or `bcs:`) -> `default:` section, locate the `dialogRect:` parameter and change the `0.75` to `0.00`. This allows subtitle detection across the entire frame.
0 commit comments