Every FFmpeg command you need, paired with an API call
This is a reference guide. Each section shows the FFmpeg command, explains what it does, and provides the exact API call to run it via RenderIO. No setup required beyond an API key.
If you're just getting started with FFmpeg, the command line tutorial for beginners covers installation and basic syntax first. Want to understand what each flag does? The FFmpeg options reference documents every option by category with examples.
Every API call follows this pattern:
Video conversion FFmpeg commands
Format conversion is the most common FFmpeg task. Most of these operations re-encode the video, which takes longer but gives you control over the output codec, quality, and file size. If you just need to change the container (e.g., MKV to MP4) without changing the codec, use stream copy instead — it finishes in under a second.
H.264 encoding (most compatible)
FFmpeg:
API:
The -preset controls encode speed vs compression. Options: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow. Slower = smaller file, same quality. For a deep dive on picking the right CRF, preset, and codec for compression specifically, see the video compression guide.
H.265/HEVC encoding (50% smaller files)
FFmpeg:
API:
CRF 28 for H.265 is roughly equivalent to CRF 23 for H.264. Same visual quality, half the file size. The complete transcoding guide covers CRF tuning, two-pass encoding, and hardware acceleration for H.265 and AV1.
VP9 encoding (web-optimized)
FFmpeg:
API:
GIF to MP4 (browser-compatible)
FFmpeg:
API:
The -pix_fmt yuv420p and scale filter are required for playback on mobile devices and browsers. Without them, most players show a black screen or error. The GIF to MP4 conversion guide covers codec choices, transparency handling, and batch processing in detail.
Stream copy (re-mux without re-encoding)
FFmpeg:
API:
This is instant. No re-encoding. Works when the source codecs are compatible with the target container.
Video manipulation FFmpeg commands
These operations modify the video content itself: dimensions, timing, orientation, or framing. They all require re-encoding since you're changing the actual frames. The -crf 23 in these examples keeps quality high without bloating the file. Adjust the number lower (better quality, bigger file) or higher (smaller file, more compression artifacts) to match your needs.
Resize (scale by height)
FFmpeg:
API:
Crop (extract center region)
FFmpeg:
API:
Syntax: crop=width:height:x:y. The iw/2-320 centers a 640px crop horizontally.
Trim by time
FFmpeg:
API:
-ss is start time, -t is duration. Use -to instead of -t for an end timestamp. The video trimming guide covers frame-accurate cutting, the trim filter, and batch trimming in detail.
Speed adjustment
FFmpeg (2x speed):
API:
For video: multiply PTS by desired_duration/original_duration. For audio: atempo accepts 0.5 to 2.0. Chain filters for larger changes.
Rotation FFmpeg commands
FFmpeg (90 degrees clockwise):
API:
Values: 0=counter-clockwise+flip, 1=clockwise, 2=counter-clockwise, 3=clockwise+flip.
For 180-degree rotation, chain two transpose filters or use the rotate filter:
Watermark FFmpeg commands
Watermarking requires two inputs: your video and the overlay image (or text). The overlay filter positions the watermark using expressions based on the video dimensions (W/H) and watermark dimensions (w/h), so the same command works regardless of resolution.
Image watermark overlay
FFmpeg:
API:
W-w-10:H-h-10 places the watermark 10 pixels from the bottom-right corner. Change the expression to position it elsewhere: 10:10 for top-left, (W-w)/2:(H-h)/2 for center. The watermark guide covers opacity, animated watermarks, and text overlays.
Text watermark
FFmpeg:
API:
The @0.5 sets the text to 50% opacity. Adjust as needed.
Audio extraction FFmpeg commands
Pulling audio out of a video file is fast because FFmpeg doesn't need to decode the video stream at all. The -vn flag tells it to skip video entirely, so these operations finish in seconds even for long files.
Video to MP3
FFmpeg:
API:
-q:a quality scale: 0 (best, ~245kbps) to 9 (worst, ~65kbps). 2 is the sweet spot.
Video to AAC
FFmpeg:
API:
Audio normalization
FFmpeg:
API:
EBU R128 standard. -16 LUFS is standard for streaming platforms.
Image and thumbnail FFmpeg commands
Extracting still images from video is one of the fastest FFmpeg operations — no re-encoding required, just decoding a single frame. You can grab a specific frame by timestamp, extract one frame every N seconds, or pull keyframes only (which is even faster since FFmpeg doesn't need to decode between keyframes).
Extract frame at timestamp
FFmpeg:
API:
Extract frames at intervals
FFmpeg:
One frame every 5 seconds. Useful for generating thumbnail strips or storyboards. The complete frame extraction guide covers scene detection, keyframe extraction, fps= vs select= performance, and batch extraction via API.
Metadata FFmpeg commands
Video files carry more metadata than most people realize: encoder software, creation date, GPS coordinates, camera model, and sometimes editing history. These commands let you inspect what's there and strip what you don't want shared.
Strip all metadata
FFmpeg:
API:
Removes all metadata: title, author, creation date, GPS coordinates, software tags. Fast because it copies streams.
Inspect metadata (ffprobe)
Not available via API, but useful for understanding your input files before building commands. The ffprobe tutorial covers JSON output, field extraction, and scripting patterns for inspecting files programmatically.
Video merging FFmpeg commands
FFmpeg has three ways to join clips: the concat demuxer (fast, same-format only), the concat filter (re-encodes, handles mixed formats), and the concat protocol (for specific container types). The filter approach is the most reliable for API use since you can't guarantee all input clips share the same codec.
Concatenate clips (same format)
FFmpeg:
API (using the concat protocol for two files):
The concat filter re-encodes, which handles clips with different codecs or resolutions. For same-format clips where you want a fast stream copy, the concat demuxer (file list approach) is faster. The complete video merging guide covers all three concatenation methods, troubleshooting, and batch merging via API.
Filter chain FFmpeg commands
When a single operation isn't enough, chain filters together. FFmpeg processes them left to right, so order matters. Resize before color correction runs faster than the reverse (fewer pixels to process). Use -vf for simple chains and -filter_complex when you need to combine multiple input streams.
Multiple filters combined
FFmpeg:
This scales to 720p, slightly brightens, increases saturation, and sharpens. Filters chain left-to-right with commas.
API:
Batch processing: run multiple FFmpeg commands at once
For processing multiple files in one request, use the /run-multiple-ffmpeg-commands endpoint:
Each command runs in its own container. The response includes a command_id per command. Poll each one individually, or use webhooks to get notified when each finishes.
This is useful for batch workflows: resize a set of videos, convert an entire folder, or generate thumbnails from multiple clips in parallel. For n8n workflows, see the n8n FFmpeg cloud workaround that covers submitting batch jobs from n8n's HTTP Request node. If you're using GPU encoding for speed, the GPU acceleration guide covers NVENC and CUDA options.
FAQ
What FFmpeg commands work with the API?
Any command that ffmpeg can run. The API executes the command string directly in a container with a full FFmpeg build, including libx264, libx265, libsvtav1, libvpx-vp9, and all standard filters. The only constraint is the max duration and storage limit for your plan.
How do I pass multiple input files to an FFmpeg API command?
Use multiple keys in the input_files object with different placeholder names. For example, {{in_video}} and {{in_logo}} for a watermark overlay, or {{in_clip1}} and {{in_clip2}} for concatenation. Each placeholder maps to a URL. The API downloads all inputs before running the command.
Can I chain FFmpeg commands (output of one as input to the next)?
Not in a single API call. Run the first command, wait for it to finish, then use the output URL as the input for the next command. For simple filter chains, combine everything into one -vf or -filter_complex expression instead. That runs as a single command and is faster.
What's the difference between -vf and -filter_complex?
-vf is shorthand for simple video filter chains on a single input. -filter_complex handles multiple inputs, multiple outputs, and graph-style filter routing. Use -vf for resize, crop, brightness, and similar single-stream operations. Use -filter_complex for overlays, concat, picture-in-picture, and anything that combines streams.
How do I know if my FFmpeg command syntax is correct before sending it to the API?
Test it locally first with ffmpeg on your machine. The API runs the same command string, so if it works locally, it works via API. If you don't have FFmpeg installed, the FFmpeg cheat sheet has tested examples for every common operation.