FarhadMadadzade
commited on
Commit
•
c031f24
1
Parent(s):
292ce47
added back only 30 second part
Browse files
app.py
CHANGED
@@ -42,9 +42,13 @@ def process_video(date):
|
|
42 |
# Download the video
|
43 |
video_path = download_video(date)
|
44 |
|
45 |
-
# Extract
|
|
|
|
|
|
|
|
|
46 |
audio_path = f"audio_{date}.wav"
|
47 |
-
AudioFileClip(
|
48 |
|
49 |
# Split the audio into chunks
|
50 |
audio = AudioSegment.from_wav(audio_path)
|
|
|
42 |
# Download the video
|
43 |
video_path = download_video(date)
|
44 |
|
45 |
+
# Extract the first 30 seconds of the video
|
46 |
+
short_video_path = f"short_{date}.mp4"
|
47 |
+
ffmpeg_extract_subclip(video_path, 0, 30, targetname=short_video_path)
|
48 |
+
|
49 |
+
# Extract audio from the short video
|
50 |
audio_path = f"audio_{date}.wav"
|
51 |
+
AudioFileClip(short_video_path).write_audiofile(audio_path)
|
52 |
|
53 |
# Split the audio into chunks
|
54 |
audio = AudioSegment.from_wav(audio_path)
|