Added: path as parameter
This commit is contained in:
parent
58a8e2b058
commit
b316b60c2a
@ -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())
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user