summaryrefslogtreecommitdiffstats
path: root/roles/caption/templates
diff options
context:
space:
mode:
Diffstat (limited to 'roles/caption/templates')
-rwxr-xr-xroles/caption/templates/process-captions.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/roles/caption/templates/process-captions.py b/roles/caption/templates/process-captions.py
index 67f82ce..b650bec 100755
--- a/roles/caption/templates/process-captions.py
+++ b/roles/caption/templates/process-captions.py
@@ -40,8 +40,8 @@ import json
import torch
THREADS = {{ cpus }}
-VIDEO_REGEXP = '\.(webm|mov|mp4|mkv)$'
-AUDIO_REGEXP = '\.(ogg|opus)$'
+VIDEO_REGEXP = '\\.(webm|mov|mp4|mkv)$'
+AUDIO_REGEXP = '\\.(ogg|opus)$'
ALWAYS = False
TRIM_AUDIO = False
MODEL = os.environ.get('MODEL', 'large') # Set to tiny for testing
@@ -107,7 +107,7 @@ def extract_audio(work):
if 'Audio: vorbis' in output.decode():
extension = 'ogg'
new_file = work['base'] + '.' + extension
- acodec = 'copy' if re.search('webm$', work['video']) else 'libopus'
+ acodec = 'copy' if re.search('\\.(webm|mp4|mkv)$', work['video']) else 'libopus'
log("Extracting audio from %s acodec %s" % (work['video'], acodec))
output = subprocess.check_output(['ffmpeg', '-y', '-i', work['video'], '-acodec', acodec, '-vn', new_file], stderr=subprocess.STDOUT)
work['audio'] = new_file