mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-04-19 12:24:59 -04:00
Improved subtitles synchronization by using webrtcvad if available.
This commit is contained in:
parent
3336cea3d0
commit
0209d1558a
3 changed files with 8 additions and 2 deletions
|
@ -47,7 +47,7 @@ import logging
|
|||
# deploy requirements.txt
|
||||
if not args.no_update:
|
||||
try:
|
||||
import lxml, numpy
|
||||
import lxml, numpy, webrtcvad
|
||||
except ImportError:
|
||||
try:
|
||||
import pip
|
||||
|
|
|
@ -16,7 +16,12 @@ class SubSyncer:
|
|||
self.srtout = None
|
||||
self.ffmpeg_path = None
|
||||
self.args = None
|
||||
self.vad = 'subs_then_auditok'
|
||||
try:
|
||||
import webrtcvad
|
||||
except ImportError:
|
||||
self.vad = 'subs_then_auditok'
|
||||
else:
|
||||
self.vad = 'subs_then_webrtc'
|
||||
self.log_dir_path = os.path.join(args.config_dir, 'log')
|
||||
|
||||
def sync(self, video_path, srt_path, srt_lang, media_type, sonarr_series_id=None, sonarr_episode_id=None,
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
lxml>=4.3.0
|
||||
numpy>=1.12.0
|
||||
webrtcvad-wheels>=2.0.10
|
Loading…
Add table
Reference in a new issue