MingGatsby commited on
Commit
2cc5a1f
1 Parent(s): 11b0f5d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -38,7 +38,7 @@ def extract_audio(video_path):
38
  clip.close()
39
  return audio_path
40
 
41
- def process_video(video_path, seconds_per_frame=2):
42
  base64Frames = extract_frames(video_path, seconds_per_frame)
43
  audio_path = extract_audio(video_path)
44
  return base64Frames, audio_path
@@ -56,7 +56,7 @@ def summarize_video(file_path, summary_detail):
56
  client = OpenAI(api_key=api_key)
57
 
58
  # 抽取幀和音頻(每0.5秒一幀)
59
- base64Frames, audio_path = process_video(file_path, seconds_per_frame=int(0.5))
60
 
61
  # 使用Whisper進行音頻轉錄
62
  transcription = client.audio.transcriptions.create(
 
38
  clip.close()
39
  return audio_path
40
 
41
+ def process_video(video_path, seconds_per_frame):
42
  base64Frames = extract_frames(video_path, seconds_per_frame)
43
  audio_path = extract_audio(video_path)
44
  return base64Frames, audio_path
 
56
  client = OpenAI(api_key=api_key)
57
 
58
  # 抽取幀和音頻(每0.5秒一幀)
59
+ base64Frames, audio_path = process_video(file_path, seconds_per_frame=0.5)
60
 
61
  # 使用Whisper進行音頻轉錄
62
  transcription = client.audio.transcriptions.create(