50 lines
885 B
Markdown
50 lines
885 B
Markdown
# Video Thumbnail Service
|
|
|
|
A lightweight microservice that generates JPEG thumbnails from video URLs using ffmpeg.
|
|
|
|
## Requirements
|
|
|
|
- Node.js 18+
|
|
- ffmpeg installed on the system
|
|
|
|
## 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
|
|
PORT=3100 npm start
|
|
```
|
|
|
|
## Usage
|
|
|
|
```http
|
|
GET /thumbnail?url=https://example.com/video.mp4
|
|
```
|
|
|
|
Returns a JPEG image extracted at 1 second.
|
|
|
|
## 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
|
|
```
|
|
|
|
## Deployment
|
|
|
|
To run your own server:
|
|
|
|
```sh
|
|
docker run -d -p 3100:3100 ghcr.io/coracle-social/vthumbs:latest
|
|
```
|