Co-authored-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com> Co-committed-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
This commit was merged in pull request #1.
This commit is contained in:
@@ -1,33 +1,62 @@
|
||||
# Video Thumbnail Service
|
||||
|
||||
A lightweight microservice that generates video thumbnails by extracting a frame using ffmpeg.
|
||||
A lightweight microservice that generates JPEG thumbnails from video URLs using ffmpeg.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Node.js 18+
|
||||
- ffmpeg installed on the system
|
||||
|
||||
## Setup
|
||||
## Environment Configuration
|
||||
|
||||
Set environment variables in your shell, process manager, or deployment platform.
|
||||
|
||||
| Variable | Default | Description |
|
||||
| --- | --- | --- |
|
||||
| `PORT` | `3100` | HTTP port used by the service |
|
||||
|
||||
### Local Run
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm start
|
||||
PORT=3100 npm start
|
||||
```
|
||||
|
||||
The service runs on port 3100 by default. Set the `PORT` environment variable to change it.
|
||||
## Docker
|
||||
|
||||
Build and run the service with Docker:
|
||||
|
||||
```bash
|
||||
docker build -t vthumbs:local .
|
||||
docker run --rm -p 3100:3100 -e PORT=3100 vthumbs:local
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
```http
|
||||
GET /thumbnail?url=https://example.com/video.mp4
|
||||
```
|
||||
|
||||
Returns a JPEG image of the first frame (at 1 second).
|
||||
Returns a JPEG image extracted at 1 second.
|
||||
|
||||
## Configuration
|
||||
|
||||
Set `VITE_THUMBNAIL_URL` in the Flotilla `.env` file to the deployed service URL:
|
||||
## Health Check
|
||||
|
||||
```http
|
||||
GET /health
|
||||
```
|
||||
VITE_THUMBNAIL_URL=https://your-thumbnail-service.example.com
|
||||
|
||||
Returns JSON:
|
||||
|
||||
```json
|
||||
{"status":"ok"}
|
||||
```
|
||||
|
||||
## Client Configuration
|
||||
|
||||
Configure your client app with the base URL where this service is deployed.
|
||||
|
||||
Example:
|
||||
|
||||
```env
|
||||
THUMBNAIL_SERVICE_URL=https://your-thumbnail-service.example.com
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user