Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions routes/video_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import time
from dotenv import load_dotenv
import os
import requests
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
from moviepy.editor import VideoFileClip
from moviepy import VideoFileClip

load_dotenv()

Expand Down Expand Up @@ -49,7 +50,7 @@ def download_and_analyze_video(video_name):
clip = VideoFileClip(video_path)
if clip.fps > 1:
logger.warning(f"High FPS detected ({clip.fps}). Reducing to 1fps.")
clip = clip.set_fps(1)
clip = clip.with_fps(1)
trimmed_path = video_path.replace(".webm", "_trimmed.mp4")
clip.write_videofile(trimmed_path, codec="libx264", audio=False, logger=None)
video_path = trimmed_path
Expand Down Expand Up @@ -92,7 +93,7 @@ def call_hello_world():
logger.info("Attempting to call test firebase function.")
firebase_function_url = "https://europe-west1-backend-tfg-1d0d5.cloudfunctions.net/hello_world"
try:
response = request.get(firebase_function_url)
response = requests.get(firebase_function_url)
if response.status_code == 200:
return jsonify(response.json()), 200
else:
Expand Down
1 change: 1 addition & 0 deletions services/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Package for service implementations."""
1 change: 1 addition & 0 deletions services/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Data layer services package."""