summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorCaleb Rascon <[email protected]>2022-07-06 12:05:10 -0500
committerGitHub <[email protected]>2022-07-06 13:05:10 -0400
commitc622e1f710920092773fe35e3ddb4a20a3958fbe (patch)
treed184bcbffb2bed7ab24d15be8b973d255db03892
parent741a8172b2cb8f1a1698750eab96b640dc989d9b (diff)
downloadbazarr-1.1.1-beta.2.tar.gz
bazarr-1.1.1-beta.2.zip
Added option to always use audio track for subtitle syncingv1.1.1-beta.2
-rw-r--r--bazarr/app/config.py3
-rw-r--r--bazarr/subtitles/tools/subsyncer.py4
-rw-r--r--frontend/src/pages/Settings/Subtitles/index.tsx8
-rw-r--r--frontend/src/types/settings.d.ts1
4 files changed, 15 insertions, 1 deletions
diff --git a/bazarr/app/config.py b/bazarr/app/config.py
index 009c4235e..ac2796d1f 100644
--- a/bazarr/app/config.py
+++ b/bazarr/app/config.py
@@ -219,7 +219,8 @@ defaults = {
'subsync_threshold': '90',
'use_subsync_movie_threshold': 'False',
'subsync_movie_threshold': '70',
- 'debug': 'False'
+ 'debug': 'False',
+ 'force_audio': 'False'
},
'series_scores': {
"hash": 359,
diff --git a/bazarr/subtitles/tools/subsyncer.py b/bazarr/subtitles/tools/subsyncer.py
index bedbbde60..7fea01fbc 100644
--- a/bazarr/subtitles/tools/subsyncer.py
+++ b/bazarr/subtitles/tools/subsyncer.py
@@ -54,6 +54,10 @@ class SubSyncer:
try:
unparsed_args = [self.reference, '-i', self.srtin, '-o', self.srtout, '--ffmpegpath', self.ffmpeg_path,
'--vad', self.vad, '--log-dir-path', self.log_dir_path]
+ if settings.subsync.getboolean('force_audio'):
+ unparsed_args.append('--no-fix-framerate ')
+ unparsed_args.append('--reference-stream')
+ unparsed_args.append('a:0')
if settings.subsync.getboolean('debug'):
unparsed_args.append('--make-test-case')
parser = make_parser()
diff --git a/frontend/src/pages/Settings/Subtitles/index.tsx b/frontend/src/pages/Settings/Subtitles/index.tsx
index adb0b56d5..2c71b3cdc 100644
--- a/frontend/src/pages/Settings/Subtitles/index.tsx
+++ b/frontend/src/pages/Settings/Subtitles/index.tsx
@@ -365,6 +365,14 @@ const SettingsSubtitlesView: FunctionComponent = () => {
<Message>Must be 4 digit octal</Message>
</CollapseBox>
<Check
+ label="Always use Audio Track as Reference for Syncing"
+ settingKey="settings-subsync-force_audio"
+ ></Check>
+ <Message>
+ Use the audio track as reference for syncing, instead of using the
+ embedded subtitle.
+ </Message>
+ <Check
label="Automatic Subtitles Synchronization"
settingKey="settings-subsync-use_subsync"
></Check>
diff --git a/frontend/src/types/settings.d.ts b/frontend/src/types/settings.d.ts
index de55125d8..1db17a0ba 100644
--- a/frontend/src/types/settings.d.ts
+++ b/frontend/src/types/settings.d.ts
@@ -111,6 +111,7 @@ declare namespace Settings {
use_subsync_movie_threshold: boolean;
subsync_movie_threshold: number;
debug: boolean;
+ force_audio: boolean;
}
interface Analytic {