HNG Stage 5: Screen Recorder Video Upload API
This API allows users to upload, process, and stream videos. Videos are processed to extract audio and generate transcriptions.
-
Requirements:
- Python 3.x
- MongoDB
-
Installation:
pip install -r requirements.txt
-
Environment Variables:
Create a
.env
file in the project directory with the following content:MONGODB_URI=<your_mongodb_connection_uri>
-
Uploading a Video:
- Endpoint:
POST /api/upload
- Request:
file
: Video file to be uploaded
- Response:
id
: Unique identifier for the uploaded videofilename
: Original filename of the uploaded videocreated_time
: Timestamp when the video was uploaded (ISO format)url
: Streaming URL for the videotranscription
: Array of transcription objects (limited to the first 3 timestamps)
- Endpoint:
-
Streaming a Video:
- Endpoint:
GET /api/videos/<video_id>/stream
- Response:
- Streamed video file (video/mp4)
- Endpoint:
-
Getting Transcription:
- Endpoint:
GET /api/transcription/<video_id>
- Response:
video_id
: Identifier for the videotranscription
: Array of transcription objects
- Endpoint:
-
Getting List of Videos:
- Endpoint:
GET /api/videos
- Response:
video_files
: Array of video objects containingid
,filename
,created_time
, andstream_url
- Endpoint:
python app.py
The API server will start at http://localhost:5000
.
- Videos are processed to extract audio and generate transcriptions.
- Videos are compressed to fit within a specified size limit (25MB).
- Transcriptions are generated every 15 seconds and associated with corresponding timestamps.