From b316b60c2ab682b5c5fa0cd12a389c203c5b8496 Mon Sep 17 00:00:00 2001 From: Markus Schmidt Date: Fri, 8 Oct 2021 15:31:19 +0200 Subject: [PATCH] Added: path as parameter --- controllers/default.py | 3 ++- modules/transcription_tools/__init__.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/controllers/default.py b/controllers/default.py index 7f8c40a..b3ee1d1 100644 --- a/controllers/default.py +++ b/controllers/default.py @@ -18,7 +18,8 @@ def manage(): return dict(grid=grid) def vtt(): - return dict(message=transcription_tools.create_vtt()) + return dict(message=transcription_tools.create_vtt( + '/home/mschmidt/Videos/100-Meinungen-Video-erstellen.mp4')) def user(): return dict(form=auth()) \ No newline at end of file diff --git a/modules/transcription_tools/__init__.py b/modules/transcription_tools/__init__.py index cd08105..f421c84 100644 --- a/modules/transcription_tools/__init__.py +++ b/modules/transcription_tools/__init__.py @@ -24,14 +24,14 @@ import json import datetime -def create_vtt(): +def create_vtt(video_path): sample_rate = 16000 model = Model("applications/transcription/private/model") rec = KaldiRecognizer(model, sample_rate) rec.SetWords(True) process = subprocess.Popen(['ffmpeg', '-loglevel', 'quiet', '-i', - '/home/mschmidt/Videos/100-Meinungen-Video-erstellen.mp4', + video_path, '-ar', str(sample_rate) , '-ac', '1', '-f', 's16le', '-'], stdout=subprocess.PIPE)