Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zahidhasann88/video-summarizer
A videos by extracting audio and generating summaries based on the audio content.
https://github.com/zahidhasann88/video-summarizer
nodejs openai typescript whisper
Last synced: 5 days ago
JSON representation
A videos by extracting audio and generating summaries based on the audio content.
- Host: GitHub
- URL: https://github.com/zahidhasann88/video-summarizer
- Owner: zahidhasann88
- Created: 2024-11-04T17:49:46.000Z (10 days ago)
- Default Branch: main
- Last Pushed: 2024-11-09T17:39:15.000Z (5 days ago)
- Last Synced: 2024-11-09T18:30:02.273Z (5 days ago)
- Topics: nodejs, openai, typescript, whisper
- Language: TypeScript
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```markdown
# Video Summarizer APIA Node.js API for summarizing videos by extracting audio and generating summaries based on the audio content. This API leverages FFmpeg for media processing.
## Table of Contents
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [API Endpoints](#api-endpoints)
- [Environment Variables](#environment-variables)
- [License](#license)## Features
- Upload videos for summarization
- Extract audio from video files
- Generate summaries from the audio content## Installation
1. **Clone the repository:**
```bash
git clone https://github.com/yourusername/video-summarizer-api.git
cd video-summarizer-api
```2. **Install dependencies:**
```bash
npm install
```3. **Install FFmpeg:**
- Download FFmpeg from [FFmpeg official site](https://ffmpeg.org/download.html).
- Follow the installation instructions for your operating system.
- Ensure that the `bin` directory of FFmpeg is added to your system's PATH.4. **Configure environment variables:**
Create a `.env` file in the root directory and add your environment variables (if applicable).## Usage
To start the API server in development mode, run:
```bash
npm run dev
```The server will start on port 5000 (default). You can change the port in the configuration if needed.
## API Endpoints
### 1. Upload Video
- **Endpoint:** `/api/upload`
- **Method:** `POST`
- **Description:** Uploads a video file for summarization.
- **Request Body:**
- `video`: (file) The video file to be processed.
- **Response:**
- `200 OK`: Returns a summary of the video.
- `400 Bad Request`: If the upload fails.### 2. Summarize Video
- **Endpoint:** `/api/summarize`
- **Method:** `POST`
- **Description:** Summarizes the uploaded video based on extracted audio.
- **Request Body:**
- `videoId`: (string) The ID of the video to summarize.
- **Response:**
- `200 OK`: Returns the summary text.
- `404 Not Found`: If the video ID does not exist.## Environment Variables
| Variable | Description |
|----------------|-----------------------------------------|
| `PORT` | Port on which the server will run |
| `OPENAI_API_KEY` | your_openai_api_key |
| `UPLOAD_DIR` | Directory for storing uploaded files |
| `MAX_FILE_SIZE`| Maximum allowed file size in bytes |