cptsubtext commited on
Commit
b830c30
·
1 Parent(s): cb4f0e8

ffmeg for determining lenght

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import streamlit as st
2
  from stable_whisper import load_model
3
  from stable_whisper import load_hf_whisper
 
4
  import requests
5
  import os
6
 
@@ -26,6 +27,7 @@ def transcribe_to_subtitle(audio_bytes, model_name):
26
  # Check file size for free tier
27
  if use_free_tier and len(audio_bytes) > 2 * 60 * 1024:
28
  st.error("Free tier only supports audio files under 2 minutes")
 
29
  return
30
 
31
  # Transcribe audio
 
1
  import streamlit as st
2
  from stable_whisper import load_model
3
  from stable_whisper import load_hf_whisper
4
+ import ffmpeg
5
  import requests
6
  import os
7
 
 
27
  # Check file size for free tier
28
  if use_free_tier and len(audio_bytes) > 2 * 60 * 1024:
29
  st.error("Free tier only supports audio files under 2 minutes")
30
+ st.error(ffmpeg.probe('in.mp4')['format']['duration'])
31
  return
32
 
33
  # Transcribe audio