younes21000 commited on
Commit
6b5a751
·
verified ·
1 Parent(s): 870da64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -36,8 +36,8 @@ def transcribe_audio(chunk):
36
 
37
  def add_subtitle(video):
38
  try:
39
- # Load video and extract audio for processing
40
- video_path = video.name if video else None
41
  if not video_path:
42
  return "No video provided!"
43
 
@@ -59,6 +59,7 @@ def add_subtitle(video):
59
 
60
  full_transcription = " ".join(transcriptions)
61
  subtitle_storage["original"] = full_transcription # Store the original subtitle
 
62
 
63
  return f"Subtitle added: {full_transcription[:100]}..." # Display first 100 characters
64
 
 
36
 
37
  def add_subtitle(video):
38
  try:
39
+ # The video is passed as a file path string, so we use it directly
40
+ video_path = video if isinstance(video, str) else None
41
  if not video_path:
42
  return "No video provided!"
43
 
 
59
 
60
  full_transcription = " ".join(transcriptions)
61
  subtitle_storage["original"] = full_transcription # Store the original subtitle
62
+ subtitle_storage["video_path"] = video_path # Store the video path
63
 
64
  return f"Subtitle added: {full_transcription[:100]}..." # Display first 100 characters
65