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
2222All 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
39391 . ** 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 admin@example.com
50+ # For custom certificates, edit traefik configuration
51+ # and place certificates in ./traefik/certs/
5252 ```
5353
54543 . ** 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
6767See 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)
0 commit comments