Spaces:
Runtime error
Runtime error
filipzawadka
commited on
Commit
•
481fed3
1
Parent(s):
830c50a
ffmpeg fix
Browse files- app.py +10 -1
- requirements.txt +1 -1
app.py
CHANGED
@@ -5,6 +5,7 @@ import requests
|
|
5 |
import subprocess
|
6 |
import os
|
7 |
import urllib.parse
|
|
|
8 |
|
9 |
term = 9
|
10 |
|
@@ -109,7 +110,15 @@ def transcribe(num1,num2):
|
|
109 |
|
110 |
if download_video(offset_time(videos[0]['videoLink'],num1,num2), "./video.mp4"):
|
111 |
#extract_audio("./video.mov", "./audio.mp3")
|
112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
|
114 |
|
115 |
demo = gr.Interface(
|
|
|
5 |
import subprocess
|
6 |
import os
|
7 |
import urllib.parse
|
8 |
+
from moviepy.editor import *
|
9 |
|
10 |
term = 9
|
11 |
|
|
|
110 |
|
111 |
if download_video(offset_time(videos[0]['videoLink'],num1,num2), "./video.mp4"):
|
112 |
#extract_audio("./video.mov", "./audio.mp3")
|
113 |
+
# Load your MP4 file
|
114 |
+
video = VideoFileClip("./video.mp4")
|
115 |
+
|
116 |
+
# Extract the audio from the video
|
117 |
+
audio = video.audio
|
118 |
+
|
119 |
+
# Write the audio to an MP3 file
|
120 |
+
audio.write_audiofile("./audio.mp3")
|
121 |
+
return transcriber("./audio.mp3")["text"]
|
122 |
|
123 |
|
124 |
demo = gr.Interface(
|
requirements.txt
CHANGED
@@ -90,4 +90,4 @@ websockets==11.0.3
|
|
90 |
widgetsnbextension==4.0.9
|
91 |
xxhash==3.4.1
|
92 |
yarl==1.9.4
|
93 |
-
|
|
|
90 |
widgetsnbextension==4.0.9
|
91 |
xxhash==3.4.1
|
92 |
yarl==1.9.4
|
93 |
+
moviepy
|