Skip to content

Commit

Permalink
Added option to always use audio track for subtitle syncing
Browse files Browse the repository at this point in the history
  • Loading branch information
balkce committed Jul 6, 2022
1 parent 741a817 commit c622e1f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bazarr/app/config.py
Expand Up @@ -219,7 +219,8 @@ def get(self, section, option, raw=False, vars=None):
'subsync_threshold': '90',
'use_subsync_movie_threshold': 'False',
'subsync_movie_threshold': '70',
'debug': 'False'
'debug': 'False',
'force_audio': 'False'
},
'series_scores': {
"hash": 359,
Expand Down
4 changes: 4 additions & 0 deletions bazarr/subtitles/tools/subsyncer.py
Expand Up @@ -54,6 +54,10 @@ def sync(self, video_path, srt_path, srt_lang, media_type, sonarr_series_id=None
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()
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/pages/Settings/Subtitles/index.tsx
Expand Up @@ -364,6 +364,14 @@ const SettingsSubtitlesView: FunctionComponent = () => {
<Text placeholder="0777" settingKey="settings-general-chmod"></Text>
<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"
Expand Down
1 change: 1 addition & 0 deletions frontend/src/types/settings.d.ts
Expand Up @@ -111,6 +111,7 @@ declare namespace Settings {
use_subsync_movie_threshold: boolean;
subsync_movie_threshold: number;
debug: boolean;
force_audio: boolean;
}

interface Analytic {
Expand Down

0 comments on commit c622e1f

Please sign in to comment.