Cloud Service Documentation
Table of Contents
Authentication
Basic Authentication
Some endpoints require authentication using HTTP Basic Authentication.
Protected Routes Example
/files/protected/example
To access protected routes, you need to include Basic Authentication credentials in your request header:
Authorization: Basic base64(username:password)
Note: Replace username:password with your actual credentials and encode them in base64 format.
For example: if your username is "user" and password is "pass", you would encode "user:pass" to base64.
Authentication Errors
| Status Code |
Description |
Solution |
| 401 |
Unauthorized - No credentials provided |
Include Basic Authentication header |
| 403 |
Forbidden - Invalid credentials |
Check your username and password |
Video Processing
Features
- HLS (HTTP Live Streaming) support
- Multiple quality variants (480p, 720p, 1080p)
- Automatic watermarking
- Adaptive bitrate streaming
- Direct MP4 file serving
Usage Examples
HLS Streaming
To stream a video using HLS:
/videos/path/movie.m3u8
This will automatically:
- Check for an existing HLS version
- Convert the video if needed
- Create multiple quality variants
- Apply watermark if available
Direct MP4 Access
To access the original MP4 file:
/videos/path/to/video.mp4
Video Processing Details
| Quality |
Resolution |
Bitrate |
Bandwidth |
| 480p |
854x480 |
1000k |
1 Mbps |
| 720p |
1280x720 |
2500k |
2.5 Mbps |
| 1080p |
1920x1080 |
5000k |
5 Mbps |
Note: Video processing may take several minutes depending on the file size and quality.
The API will return a processing status while the conversion is in progress.
Watermarking
To enable watermarking:
- Place a PNG file named
watermark.png in your domain's root directory
- The watermark will be automatically applied to all processed videos
- Watermark specifications:
- Height: 20px (width maintains aspect ratio)
- Position: Bottom-left corner
- Margins: 20px from left and bottom edges
Audio Processing
Features
- MPEG-DASH (Dynamic Adaptive Streaming over HTTP) support
- Multiple bitrate variants (64kbps, 128kbps, 320kbps)
- Adaptive bitrate streaming
- Direct audio file serving
- Format conversion and optimization
Supported Formats
| Format |
Input |
Output |
| MP3 |
Yes |
Yes (DASH Streaming) |
| AAC |
Yes |
Yes (DASH Streaming) |
| WAV |
Yes |
Converted to AAC |
| OGG |
Yes |
Converted to AAC |
| FLAC |
Yes |
Converted to AAC |
Usage Examples
DASH Audio Streaming
To stream an audio file using DASH:
/audios/path/audio.mpd
This will automatically:
- Check for an existing DASH version
- Convert the audio if needed
- Create multiple bitrate variants
- Generate DASH manifest
Direct Audio Access
To access the original audio file:
/audios/path/to/audio.mp3
Audio Processing Details
| Quality |
Bitrate |
Format |
Use Case |
| Low |
64 kbps |
AAC |
Mobile data saving |
| Medium |
128 kbps |
AAC |
Standard quality |
| High |
320 kbps |
AAC |
High quality audio |
Note: Audio processing may take several minutes depending on the file size and quality.
The API will return a processing status (202 Accepted) while the conversion is in progress.
The DASH manifest and segments will be available at audio_[FILENAME]_dash/manifest.mpd.
Image Processing
Features
- Automatic resizing
- Format conversion
- Watermarking
- Caching
- GIF optimization
- SVG support
- Multiple format handling
Supported Formats
| Format |
Features |
Processing |
| JPEG/JPG |
- Quality adjustment
- Resizing
- Format conversion
- Watermarking
|
Full processing with caching |
| PNG |
- Transparency support
- Resizing
- Format conversion
- Watermarking
|
Full processing with caching |
| GIF |
- Animation support
- Frame optimization
- Direct serving
|
Direct serving (no processing) |
| SVG |
- Vector graphics
- Scalable resolution
- Direct serving
|
Direct serving (no processing) |
| WebP |
- Modern format
- Better compression
- Animation support
|
Full processing with caching |
Note about GIF and SVG: These formats are served directly without processing to maintain their special features (animation for GIF, vector scaling for SVG).
Image Processing URL Format
/images/path/to/image.jpg?width=800&height=600
Available Parameters:
width: Target width in pixels
height: Target height in pixels
quality: JPEG quality (1-100)
format: Output format (jpg, png, webp)
Note: Processed images are automatically cached for improved performance.
The cache is created with a "_none" suffix for all formats except SVG and GIF.
File Handling
Features
- Secure file serving
- Support for various file types
- Proper MIME type handling
File Access URL Format
/files/path/to/file.ext
Error Handling
The service provides proper error responses:
- 404: File not found
- 415: Unsupported media type
- 500: Internal server error
Security Note: All file access is validated and sanitized to prevent directory traversal attacks.