Skip to content

Commit e83dae9

Browse files
committed
Fixed Issues
1 parent 0f9382a commit e83dae9

File tree

7 files changed

+120
-108
lines changed

7 files changed

+120
-108
lines changed

.env.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Rendiff FFmpeg API - Production Environment Configuration
1+
# FFmpeg API - Production Environment Configuration
22
# Copy this file to .env and configure for your environment
33

44
# =============================================================================
@@ -24,8 +24,8 @@ API_LOG_LEVEL=info
2424
# Production PostgreSQL (Recommended)
2525
DATABASE_URL=postgresql://ffmpeg_user:your_secure_password@postgres:5432/ffmpeg_api
2626

27-
# Alternative: SQLite (Development Only)
28-
# DATABASE_URL=sqlite+aiosqlite:///data/rendiff.db
27+
# Alternative: SQLite (Development Only)
28+
# DATABASE_URL=sqlite+aiosqlite:///data/ffmpeg_api.db
2929

3030
# Database Pool Settings
3131
DATABASE_POOL_SIZE=20
@@ -52,7 +52,7 @@ WORKER_TASK_TIME_LIMIT=21600
5252
# Storage Paths
5353
STORAGE_CONFIG=/app/config/storage.yml
5454
STORAGE_PATH=./storage
55-
TEMP_PATH=/tmp/rendiff
55+
TEMP_PATH=/tmp/ffmpeg_api
5656

5757
# Data Persistence Paths (for Docker volumes)
5858
POSTGRES_DATA_PATH=./data/postgres

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ A high-performance, production-ready FFmpeg API designed to replace complex CLI
2626
### 1. Clone & Deploy (60 seconds)
2727

2828
```bash
29-
git clone https://github.com/rendiffdev/ffmpeg-api.git
29+
git clone <repository-url>
3030
cd ffmpeg-api
3131

3232
# Choose your deployment type
@@ -50,12 +50,10 @@ open http://localhost:8000/docs
5050
```bash
5151
curl -X POST "http://localhost:8000/api/v1/convert" \\
5252
-H "Content-Type: application/json" \\
53+
-H "X-API-Key: your-api-key" \\
5354
-d '{
54-
"input": "/path/to/input.mp4",
55-
"output": "/path/to/output.webm",
56-
"operations": [
57-
{"type": "transcode", "params": {"video_codec": "vp9", "crf": 30}}
58-
]
55+
"input": "/storage/input.mp4",
56+
"output": "mp4"
5957
}'
6058
```
6159

@@ -322,4 +320,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
322320

323321
**Transform your video processing workflow with production-ready FFmpeg API.**
324322

325-
*Built with ❤️ by the Rendiff team*
323+
*Production-ready FFmpeg API for professional video processing*

compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
# Traefik Reverse Proxy
88
traefik:
99
image: traefik:v3.1
10-
container_name: rendiff_traefik
10+
container_name: ffmpeg_traefik
1111
command:
1212
- --configFile=/etc/traefik/traefik.yml
1313
ports:
@@ -34,7 +34,7 @@ services:
3434
# API Gateway (now behind Traefik)
3535
krakend:
3636
image: devopsfaith/krakend:2.7
37-
container_name: rendiff_gateway
37+
container_name: ffmpeg_gateway
3838
volumes:
3939
- ./config/krakend.json:/etc/krakend/krakend.json:ro
4040
# No port exposure - accessed through Traefik
@@ -53,7 +53,7 @@ services:
5353
# Database Service
5454
postgres:
5555
image: postgres:16-alpine
56-
container_name: rendiff_postgres
56+
container_name: ffmpeg_postgres
5757
environment:
5858
POSTGRES_DB: ffmpeg_api
5959
POSTGRES_USER: ffmpeg_user
@@ -93,7 +93,7 @@ services:
9393
# Queue Service (Redis)
9494
redis:
9595
image: redis:7.2-alpine
96-
container_name: rendiff_redis
96+
container_name: ffmpeg_redis
9797
command: >
9898
redis-server
9999
--appendonly yes
@@ -148,7 +148,7 @@ services:
148148
platforms:
149149
- linux/amd64
150150
- linux/arm64
151-
container_name: rendiff_api
151+
container_name: ffmpeg_api
152152
environment:
153153
DATABASE_URL: ${DATABASE_URL:-postgresql://ffmpeg_user:defaultpassword@postgres:5432/ffmpeg_api}
154154
REDIS_URL: redis://redis:6379/0

docs/API.md

Lines changed: 85 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Rendiff API Documentation
1+
# FFmpeg API Documentation
22

3-
Complete API reference for the Rendiff FFmpeg API service.
3+
Complete API reference for the production-ready FFmpeg API service.
44

55
## Table of Contents
66

@@ -15,20 +15,20 @@ Complete API reference for the Rendiff FFmpeg API service.
1515

1616
## Overview
1717

18-
The Rendiff API provides a RESTful interface to FFmpeg's media processing capabilities with hardware acceleration support.
18+
The FFmpeg API provides a RESTful interface to FFmpeg's media processing capabilities with hardware acceleration support.
1919

2020
> **💡 New to setup?** See the [Setup Guide](SETUP.md) for deployment instructions.
2121
2222
All API requests should be made to:
2323

2424
```
25-
http://your-server:8000/api/v1
25+
http://localhost:8000/api/v1
2626
```
2727

2828
### Base URL Structure
2929

3030
- Development: `http://localhost:8000/api/v1`
31-
- Production: `https://your-domain.com/api/v1` (HTTPS recommended)
31+
- Production: `https://your-domain.com/api/v1` (Configure with your domain)
3232

3333
### HTTPS Configuration
3434

@@ -38,31 +38,31 @@ For production deployments, HTTPS is strongly recommended. The API supports both
3838

3939
1. **Interactive Setup**: Run the setup wizard and choose HTTPS options
4040
```bash
41-
./scripts/interactive-setup.sh
42-
# Choose option 2 (self-signed) or 3 (Let's Encrypt) for SSL configuration
41+
./setup.sh --standard
42+
# Production setup includes HTTPS with self-signed certificates
4343
```
4444

45-
2. **Manual Certificate Generation**:
45+
2. **Certificate Management**:
4646
```bash
47-
# Self-signed certificate
48-
./scripts/manage-ssl.sh generate-self-signed your-domain.com
47+
# Standard setup includes HTTPS with self-signed certificates
48+
./setup.sh --standard
4949

50-
# Let's Encrypt certificate
51-
./scripts/manage-ssl.sh generate-letsencrypt your-domain.com [email protected]
50+
# For custom certificates, edit traefik configuration
51+
# and place certificates in ./traefik/certs/
5252
```
5353

5454
3. **Deploy with HTTPS**:
5555
```bash
56-
# Production deployment with Traefik (includes HTTPS)
57-
docker compose -f docker compose.prod.yml --profile traefik up -d
56+
# Production deployment with HTTPS enabled by default
57+
./setup.sh --standard
5858
```
5959

6060
#### SSL Certificate Management
6161

62-
- **List certificates**: `./scripts/manage-ssl.sh list`
63-
- **Test SSL setup**: `./scripts/manage-ssl.sh test your-domain.com`
64-
- **Validate configuration**: `./scripts/manage-ssl.sh validate your-domain.com`
65-
- **Renew certificates**: `./scripts/manage-ssl.sh renew`
62+
- **Check deployment status**: `./setup.sh --status`
63+
- **View Traefik logs**: `docker compose logs traefik`
64+
- **Restart SSL services**: `docker compose restart traefik`
65+
- **Certificate location**: `./traefik/certs/`
6666

6767
See the [SSL Management Guide](SETUP.md#httpssl-configuration) for detailed information.
6868

@@ -519,59 +519,80 @@ curl -X POST http://localhost:8000/api/v1/stream \
519519
}'
520520
```
521521

522-
## SDKs
522+
## API Client Examples
523523

524-
### Python SDK
524+
### Python Client
525525

526526
```python
527-
from rendiff import RendiffClient
528-
529-
client = RendiffClient(api_key="your-api-key", base_url="http://localhost:8000")
530-
531-
# Simple conversion
532-
job = client.convert(
533-
input="/storage/input/video.avi",
534-
output="mp4"
535-
)
536-
537-
# Monitor progress
538-
for progress in job.watch():
539-
print(f"Progress: {progress.percentage}%")
540-
541-
# Get result
542-
result = job.wait()
543-
print(f"Output: {result.output_path}")
544-
```
545-
546-
### JavaScript SDK
527+
import requests
528+
import time
529+
530+
class FFmpegAPIClient:
531+
def __init__(self, api_key, base_url="http://localhost:8000"):
532+
self.api_key = api_key
533+
self.base_url = base_url
534+
self.headers = {"X-API-Key": api_key, "Content-Type": "application/json"}
535+
536+
def convert(self, input_path, output_format):
537+
response = requests.post(
538+
f"{self.base_url}/api/v1/convert",
539+
json={"input": input_path, "output": output_format},
540+
headers=self.headers
541+
)
542+
return response.json()
543+
544+
def get_job_status(self, job_id):
545+
response = requests.get(
546+
f"{self.base_url}/api/v1/jobs/{job_id}",
547+
headers=self.headers
548+
)
549+
return response.json()
550+
551+
# Usage
552+
client = FFmpegAPIClient(api_key="your-api-key")
553+
job = client.convert("/storage/input/video.avi", "mp4")
554+
print(f"Job ID: {job['job']['id']}")
555+
```
556+
557+
### JavaScript Client
547558

548559
```javascript
549-
import { RendiffClient } from '@rendiff/sdk';
550-
551-
const client = new RendiffClient({
552-
apiKey: 'your-api-key',
553-
baseUrl: 'http://localhost:8000'
554-
});
555-
556-
// Convert with async/await
557-
const job = await client.convert({
558-
input: '/storage/input/video.avi',
559-
output: 'mp4'
560-
});
561-
562-
// Watch progress
563-
job.onProgress((progress) => {
564-
console.log(`Progress: ${progress.percentage}%`);
565-
});
560+
class FFmpegAPIClient {
561+
constructor(apiKey, baseUrl = 'http://localhost:8000') {
562+
this.apiKey = apiKey;
563+
this.baseUrl = baseUrl;
564+
this.headers = {
565+
'X-API-Key': apiKey,
566+
'Content-Type': 'application/json'
567+
};
568+
}
569+
570+
async convert(input, output) {
571+
const response = await fetch(`${this.baseUrl}/api/v1/convert`, {
572+
method: 'POST',
573+
headers: this.headers,
574+
body: JSON.stringify({ input, output })
575+
});
576+
return response.json();
577+
}
578+
579+
async getJobStatus(jobId) {
580+
const response = await fetch(`${this.baseUrl}/api/v1/jobs/${jobId}`, {
581+
headers: this.headers
582+
});
583+
return response.json();
584+
}
585+
}
566586

567-
// Wait for completion
568-
const result = await job.wait();
569-
console.log(`Output: ${result.outputPath}`);
587+
// Usage
588+
const client = new FFmpegAPIClient('your-api-key');
589+
const job = await client.convert('/storage/input/video.avi', 'mp4');
590+
console.log(`Job ID: ${job.job.id}`);
570591
```
571592

572593
### cURL Examples
573594

574-
See the [examples directory](../examples/) for more cURL examples and use cases.
595+
Basic API usage with cURL commands.
575596

576597
## Rate Limiting
577598

@@ -580,7 +601,7 @@ Default rate limits per API key:
580601
- 1000 requests/hour
581602
- 10 concurrent jobs
582603

583-
These can be configured in the KrakenD gateway configuration.
604+
Rate limits are configurable through environment variables and can be adjusted based on your API key tier.
584605

585606
## Webhooks
586607

@@ -790,5 +811,5 @@ The API automatically redirects HTTP traffic to HTTPS when SSL is enabled.
790811

791812
- API Documentation: http://localhost:8000/docs
792813
- OpenAPI Schema: http://localhost:8000/openapi.json
793-
- GitHub: https://github.com/rendiffdev/ffmpeg-api
794-
- Discord: https://discord.gg/rendiff
814+
- Health Check: http://localhost:8000/api/v1/health
815+
- Metrics: http://localhost:9090 (if monitoring enabled)

docs/INSTALLATION.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Rendiff Installation Guide
1+
# FFmpeg API Installation Guide
22

3-
This guide covers various installation methods for the Rendiff FFmpeg API service.
3+
This guide covers various installation methods for the FFmpeg API service.
44

55
> **🚀 Quick Setup?** Use the [unified setup script](../setup.sh) for one-command deployment.
66
> **📖 Detailed Setup?** See the [Setup Guide](SETUP.md) for comprehensive deployment documentation.
@@ -32,16 +32,16 @@ This guide covers various installation methods for the Rendiff FFmpeg API servic
3232
- Git
3333
- Python 3.12+ (for manual installation)
3434

35-
> **Note**: PostgreSQL is no longer required! Rendiff now uses SQLite as the default database, which is automatically managed within the application. No external database setup is needed.
35+
> **Note**: PostgreSQL is optional! The API supports both SQLite (for development) and PostgreSQL (for production), which can be configured during setup.
3636
3737
## Quick Start with Setup Wizard
3838

39-
The fastest and easiest way to get Rendiff running:
39+
The fastest and easiest way to get the FFmpeg API running:
4040

4141
### Step 1: Clone Repository
4242

4343
```bash
44-
git clone https://github.com/rendiffdev/ffmpeg-api.git
44+
git clone <repository-url>
4545
cd ffmpeg-api
4646
```
4747

0 commit comments

Comments
 (0)