## MODIFIED Requirements ### Requirement: Video Content Analysis The system SHALL provide functionality to analyze video content using Alibaba Cloud DashScope MultiModal API. The system SHALL extract video frames at a configurable fps rate. The system SHALL call the DashScope API with the video file and analysis prompt. The system SHALL log complete request and response content for all DashScope API calls. The system SHALL save the analysis results to MongoDB. #### Scenario: Successful Video Analysis - **WHEN** a user requests analysis for an uploaded video - **THEN** the system SHALL read the video file from storage - **AND** the system SHALL call DashScope MultiModalConversation API with the video file and fps parameter (default: 2) - **AND** the system SHALL log the complete request content including model, messages, fps, and other parameters (with sensitive information masked) - **AND** the system SHALL receive the analysis result from the API - **AND** the system SHALL log the complete response content including status code, response body, and headers - **AND** the system SHALL save the analysis result to MongoDB with video_id, analysis_type, content, fps, and created_at - **AND** the system SHALL update the video status to "analyzed" - **AND** the system SHALL return the analysis result to the user #### Scenario: Analysis API Failure - **WHEN** the DashScope API call fails (network error, API error, etc.) - **THEN** the system SHALL handle the error gracefully - **AND** the system SHALL log the complete error response including status code, error message, and request details - **AND** the system SHALL update the video status to "failed" - **AND** the system SHALL return an appropriate error message to the user - **AND** the system SHALL log the error for debugging ### Requirement: Video Summary Generation The system SHALL provide functionality to generate a summary of video content. The system SHALL use the DashScope API to analyze the video using the correct local file path format (`file://{absolute_path}`) and generate a summary based on a predefined prompt template. The system SHALL log complete request and response content for all DashScope API calls. The system SHALL save the summary to MongoDB. #### Scenario: Successful Summary Generation - **WHEN** a user requests a summary for an analyzed video - **THEN** the system SHALL construct the file path in the format `file://{absolute_path}` - **AND** the system SHALL call the DashScope API with the correctly formatted video file path and summary prompt - **AND** the system SHALL log the complete request and response content - **AND** the system SHALL receive the summary text from the API - **AND** the system SHALL save the summary to MongoDB with video_id, summary_text, and created_at - **AND** the system SHALL return the summary to the user ### Requirement: Video Comparison The system SHALL provide functionality to compare content between multiple videos. The system SHALL extract content from each video using the correct local file path format (`file://{absolute_path}`). The system SHALL generate a comparison analysis highlighting similarities and differences. The system SHALL log complete request and response content for all DashScope API calls. The system SHALL save the comparison result to MongoDB. #### Scenario: Successful Video Comparison - **WHEN** a user requests comparison between two or more videos - **THEN** the system SHALL construct file paths for each video in the format `file://{absolute_path}` - **AND** the system SHALL call the DashScope API with multiple correctly formatted video file paths and comparison prompt - **AND** the system SHALL log the complete request and response content - **AND** the system SHALL generate a comparison result - **AND** the system SHALL save the comparison to MongoDB with video_ids, comparison_result, and created_at - **AND** the system SHALL return the comparison result to the user