Inline vs. Asynchronous Processing
- Fast Jobs (Inline 200 OK): Lightweight operations like container remuxing (e.g.
MOV→MP4stream copy) are processed quickly inline and served immediately with a200 OK. - Heavy Jobs (Async 202 Accepted): Intensive operations (like full H.264/VP9 re-encodes, HLS segmentation, or GIF conversion) run asynchronously in the background.
How Asynchronous Processing Works:
- First Request: You request a heavy video transformation (e.g.,
?format=webm&fps=30). - Dreep Responds: Dreep queues the job and responds with an HTTP
202 Acceptedstatus code.- If requested by a browser (
Accept: text/html), Dreep serves a “Processing” page with a loading spinner that automatically refreshes. - If requested via an API client (
Accept: application/json), Dreep returns{ "error": "Asset is processing" }.
- If requested by a browser (
- Completion: Once the background worker finishes, subsequent requests to that exact URL return
200 OKand serve the transformed video file directly from cache.
1. Dimensions, Fit & Quality
Control output resolution, aspect ratio scaling, and visual quality.
Example:
Resize a video to 720p HD with aspect-ratio containment:
2. Trimming & Clipping
You can extract a specific portion of a video by defining start and end timestamps.
Example:
Extract a 15-second clip starting at the 10-second mark:
3. Formatting & Codecs
Convert videos to different web-optimized formats or codecs. Supported source video formats include MP4, MOV, and WebM.Conversion Boundaries: Video conversions must remain within video formats
(
mp4, webm, mov), HLS (hls, m3u8), or animated gif. If you request
an image format (like jpeg or webp) on a video asset, Dreep will extract a
static thumbnail frame.trimStart and trimEnd alongside fps when generating GIFs to keep the file size manageable.
4. HLS Adaptive Streaming
For large videos, serving a single massive.mp4 file is inefficient. Dreep supports HTTP Live Streaming (HLS), which chunks your video into smaller .ts segments and generates an .m3u8 manifest file.
This allows players to stream the video smoothly and buffer only what is needed.
To generate an HLS stream, request the video with format=hls or append the .m3u8 extension:
Implementing an HLS Player
Standard HTML5<video> tags do not support HLS natively in all browsers (Safari does, but Chrome/Firefox do not). You must use a library like HLS.js or Video.js.
Like all video transformations, requesting
.m3u8 for the first time will
trigger a 202 Accepted response while the video is chunked and the manifest
is generated.4. Audio Extraction
Because it does not require a full video re-encode, Dreep can extract audio tracks from your video assets at lightning speeds (often returning in under 200ms). To strip the video track and return just the audio, simply request one of our supported audio formats (mp3, wav, or aac).
Supported Audio Formats:
mp3: Highly compressed, great for general web usage.wav: Uncompressed lossless audio for professional use.aac: High-quality compressed audio format.
5. Thumbnail Extraction
To generate a static thumbnail image from your video, simply request a supported image format (jpeg, jpg, png, or webp) and use the time parameter to specify the exact timestamp (in seconds) to capture. If time exceeds the video’s actual duration, Dreep intelligently clamps it to the final frame.
Supported Thumbnail Formats:
jpegorjpg: Standard compressed image format, highly compatible.webp: Modern web format with superior compression.png: Lossless image format, good for high fidelity.
.jpg or format=jpg interchangeably with jpeg!)
Example: Extract a WebP Thumbnail at 15 seconds