Improved subtitles synchronization by using webrtcvad if available.

This commit is contained in:
Louis Vézina 2020-09-14 10:18:10 -04:00
parent 3336cea3d0
commit 0209d1558a
3 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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,

View File

@ -1,2 +1,3 @@
lxml>=4.3.0
numpy>=1.12.0
webrtcvad-wheels>=2.0.10