FFmpeg Commands List with API Examples

March 13, 2026 · RenderIO

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:

curl -X POST https://renderio.dev/api/v1/run-ffmpeg-command \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -d '{
    "ffmpeg_command": "YOUR_COMMAND_HERE",
    "input_files": { "input": "https://your-file-url.com/video.mp4" },
    "output_files": { "output": "result.mp4" }
  }'

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:

ffmpeg -i input.mov -c:v libx264 -preset medium -crf 23 -c:a aac -b:a 128k output.mp4

API:

{
  "ffmpeg_command": "-i {{in_input}} -c:v libx264 -preset medium -crf 23 -c:a aac -b:a 128k {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mov" },
  "output_files": { "out_output": "output.mp4" }
}

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:

ffmpeg -i input.mp4 -c:v libx265 -crf 28 -c:a aac output.mp4

API:

{
  "ffmpeg_command": "-i {{in_input}} -c:v libx265 -crf 28 -c:a aac {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "h265-output.mp4" }
}

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:

ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 -c:a libopus output.webm

API:

{
  "ffmpeg_command": "-i {{in_input}} -c:v libvpx-vp9 -crf 30 -b:v 0 -c:a libopus {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "output.webm" }
}

GIF to MP4 (browser-compatible)

FFmpeg:

ffmpeg -i input.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -c:v libx264 -crf 20 output.mp4

API:

{
  "ffmpeg_command": "-i {{in_input}} -movflags faststart -pix_fmt yuv420p -vf \"scale=trunc(iw/2)*2:trunc(ih/2)*2\" -c:v libx264 -crf 20 {{out_output}}",
  "input_files": { "in_input": "https://example.com/animation.gif" },
  "output_files": { "out_output": "converted.mp4" }
}

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:

ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4

API:

{
  "ffmpeg_command": "-i {{in_input}} -c:v copy -c:a copy {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mkv" },
  "output_files": { "out_output": "output.mp4" }
}

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:

ffmpeg -i input.mp4 -vf "scale=-2:720" -c:v libx264 -crf 23 output.mp4

API:

{
  "ffmpeg_command": "-i {{in_input}} -vf scale=-2:720 -c:v libx264 -crf 23 {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "720p.mp4" }
}

Crop (extract center region)

FFmpeg:

ffmpeg -i input.mp4 -vf "crop=640:480:iw/2-320:ih/2-240" output.mp4

API:

{
  "ffmpeg_command": "-i {{in_input}} -vf \"crop=640:480:iw/2-320:ih/2-240\" -c:v libx264 -crf 23 {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "cropped.mp4" }
}

Syntax: crop=width:height:x:y. The iw/2-320 centers a 640px crop horizontally.

Trim by time

FFmpeg:

ffmpeg -i input.mp4 -ss 00:00:30 -t 00:01:00 -c copy output.mp4

API:

{
  "ffmpeg_command": "-i {{in_input}} -ss 00:00:30 -t 00:01:00 -c copy {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "trimmed.mp4" }
}

-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):

ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mp4

API:

{
  "ffmpeg_command": "-i {{in_input}} -filter_complex \"[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]\" -map \"[v]\" -map \"[a]\" {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "fast.mp4" }
}

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):

ffmpeg -i input.mp4 -vf "transpose=1" -c:v libx264 output.mp4

API:

{
  "ffmpeg_command": "-i {{in_input}} -vf \"transpose=1\" -c:v libx264 -crf 23 {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "rotated.mp4" }
}

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:

{
  "ffmpeg_command": "-i {{in_input}} -vf \"transpose=1,transpose=1\" -c:v libx264 -crf 23 {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "rotated-180.mp4" }
}

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:

ffmpeg -i input.mp4 -i logo.png -filter_complex "overlay=W-w-10:H-h-10" -c:v libx264 -crf 23 output.mp4

API:

{
  "ffmpeg_command": "-i {{in_video}} -i {{in_logo}} -filter_complex \"overlay=W-w-10:H-h-10\" -c:v libx264 -crf 23 {{out_video}}",
  "input_files": {
    "in_video": "https://example.com/input.mp4",
    "in_logo": "https://example.com/logo.png"
  },
  "output_files": { "out_video": "watermarked.mp4" }
}

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:

ffmpeg -i input.mp4 -vf "drawtext=text='My Brand':fontsize=24:fontcolor=white@0.5:x=W-tw-10:y=H-th-10" -c:v libx264 -crf 23 output.mp4

API:

{
  "ffmpeg_command": "-i {{in_input}} -vf \"drawtext=text='My Brand':fontsize=24:fontcolor=white@0.5:x=W-tw-10:y=H-th-10\" -c:v libx264 -crf 23 {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "text-watermarked.mp4" }
}

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:

ffmpeg -i input.mp4 -vn -acodec libmp3lame -q:a 2 output.mp3

API:

{
  "ffmpeg_command": "-i {{in_input}} -vn -acodec libmp3lame -q:a 2 {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "audio.mp3" }
}

-q:a quality scale: 0 (best, ~245kbps) to 9 (worst, ~65kbps). 2 is the sweet spot.

Video to AAC

FFmpeg:

ffmpeg -i input.mp4 -vn -acodec aac -b:a 192k output.m4a

API:

{
  "ffmpeg_command": "-i {{in_input}} -vn -acodec aac -b:a 192k {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "audio.m4a" }
}

Audio normalization

FFmpeg:

ffmpeg -i input.mp4 -af loudnorm=I=-16:TP=-1.5:LRA=11 -c:v copy output.mp4

API:

{
  "ffmpeg_command": "-i {{in_input}} -af loudnorm=I=-16:TP=-1.5:LRA=11 -c:v copy {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "normalized.mp4" }
}

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:

ffmpeg -i input.mp4 -ss 00:00:10 -vframes 1 -q:v 2 thumb.jpg

API:

{
  "ffmpeg_command": "-i {{in_input}} -ss 00:00:10 -vframes 1 -q:v 2 {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "thumb.jpg" }
}

Extract frames at intervals

FFmpeg:

ffmpeg -i input.mp4 -vf "fps=1/5" frame_%03d.jpg

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:

ffmpeg -i input.mp4 -map_metadata -1 -c:v copy -c:a copy output.mp4

API:

{
  "ffmpeg_command": "-i {{in_input}} -map_metadata -1 -c:v copy -c:a copy {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "clean.mp4" }
}

Removes all metadata: title, author, creation date, GPS coordinates, software tags. Fast because it copies streams.

Inspect metadata (ffprobe)

ffprobe -v quiet -print_format json -show_format -show_streams input.mp4

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:

ffmpeg -f concat -safe 0 -i files.txt -c copy merged.mp4

API (using the concat protocol for two files):

{
  "ffmpeg_command": "-i {{in_clip1}} -i {{in_clip2}} -filter_complex \"[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1[outv][outa]\" -map \"[outv]\" -map \"[outa]\" -c:v libx264 -crf 23 {{out_merged}}",
  "input_files": {
    "in_clip1": "https://example.com/clip1.mp4",
    "in_clip2": "https://example.com/clip2.mp4"
  },
  "output_files": { "out_merged": "merged.mp4" }
}

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:

ffmpeg -i input.mp4 -vf "scale=-2:720,eq=brightness=0.04:saturation=1.1,unsharp=5:5:1.0" -c:v libx264 -crf 23 output.mp4

This scales to 720p, slightly brightens, increases saturation, and sharpens. Filters chain left-to-right with commas.

API:

{
  "ffmpeg_command": "-i {{in_input}} -vf \"scale=-2:720,eq=brightness=0.04:saturation=1.1,unsharp=5:5:1.0\" -c:v libx264 -crf 23 {{out_output}}",
  "input_files": { "in_input": "https://example.com/input.mp4" },
  "output_files": { "out_output": "processed.mp4" }
}

Batch processing: run multiple FFmpeg commands at once

For processing multiple files in one request, use the /run-multiple-ffmpeg-commands endpoint:

curl -X POST https://renderio.dev/api/v1/run-multiple-ffmpeg-commands \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -d '{
    "commands": [
      {
        "ffmpeg_command": "-i {{in_video1}} -vf scale=-2:720 -c:v libx264 -crf 23 {{out_video1}}",
        "input_files": { "in_video1": "https://example.com/vid1.mp4" },
        "output_files": { "out_video1": "720p_vid1.mp4" }
      },
      {
        "ffmpeg_command": "-i {{in_video2}} -vf scale=-2:720 -c:v libx264 -crf 23 {{out_video2}}",
        "input_files": { "in_video2": "https://example.com/vid2.mp4" },
        "output_files": { "out_video2": "720p_vid2.mp4" }
      }
    ]
  }'

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.