How to Use FFmpeg in Grok
FFmpeg handles precise media jobs: trimming recordings, resizing video, cropping frames, and converting formats. Choose it when you can specify the edit with timestamps, dimensions, and an output format.
Prompts to try with FFmpeg in Grok
Copy an example into Grok, or ask in your own words.
Use FFmpeg to keep 00:00:15 through 00:00:30 of the supplied recording, with an exact opening frame.
Use FFmpeg to resize this 1920 × 1080 video to 1280 × 720.
Use FFmpeg to crop this landscape video to a centered square using its full height.
Use FFmpeg to save a PNG image from this video at 00:00:10.
Use FFmpeg to join these three clips in the supplied order, checking that their encodings match first.
How to set up FFmpeg in Grok
Pick the way that suits you. Each takes about two minutes.
Use the Grok connector
- Add a custom connector
In Grok open Settings › Connect Apps, then Add a custom connector. Name it Spiral, paste this URL, leave Headers empty and click Add MCP.
https://api.spiral.ai/mcp
- Sign in to Spiral and approve
Grok opens Spiral: sign in, pick the organization and click Authorize. Spiral gives the connection its own API key; Grok never sees it, and you can remove the connection under Settings › Connected apps.
- Check that it is connected
Connect Apps › Custom shows Spiral as Connected. It works in every Grok chat and Grok bot.
Use the Spiral skill
- Send Grok this message
Your agent reads Spiral's skill and sets itself up.
set up https://spiral.ai/SKILL.md
- Sign in or paste a key
Approve Spiral in the browser, or give the agent a key from the console.
Use the Spiral CLI
- Install and sign in
Installs the Spiral CLI, signs you in and adds its skill to your coding agents.
npx -y spiral-cli@latest init
Call the Spiral API
- Create an API key
In the console, under API keys.
- Run FFmpeg
One request; the result comes back by polling or a webhook.
curl https://api.spiral.ai/v1/runs \ -H "Authorization: Bearer $SPIRAL_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "provider": "spiral", "model": "ffmpeg", "input": { "command": "<command>" } }'
Then paste one of the prompts above: Grok finds FFmpeg on Spiral, shows the price and runs it.
FFmpeg providers and prices
Spiral runs FFmpeg through Spiral. Open a card for today's price, with every fee included.
$0.0013 per run, plus $0.00052 per second FFmpeg runs (whole seconds, at least one). Held at max_seconds, default 300.
Settings you can ask for
FFmpeg works from your command and inputs. Ask Grok for any of these in your prompt.
| Setting | Allowed values | Default | Description |
|---|---|---|---|
| Max seconds | 1 to 1800 | 300 | The longest FFmpeg may run, in seconds. The hold is this many seconds; the charge is the seconds it ran. |
Every API field of FFmpeg Media Editor is on its tool page: open its card above.
What can you do with FFmpeg in Grok?
Make excerpts, square crops, and still images from supplied videos with FFmpeg. Describe the edit with exact times and dimensions so the agent can translate it into a command.
Cut a demo excerpt
Keep a specific section of a product recording using exact start and end timestamps.
Prepare smaller review copies
Resize footage to 1280 × 720 for review, with an explicit compression quality target.
Crop a square product clip
Select a square area from landscape footage for a product listing.
Export tutorial screenshots
Extract still frames at chosen timestamps for instructions or release notes.
Assemble a lesson
Join approved clips in order after checking that their media properties match.
Convert delivery formats
Convert an existing recording to the container and encoding required by its destination.
Create compressed previews
Encode preview videos with a specified quality target while keeping the source dimensions.
FFmpeg success rate and speed on Spiral
Success and speed over the last 24 hours, across every run of these tools on Spiral.
| Tool | Success | Median time | Runs |
|---|---|---|---|
| FFmpeg Media Editor | 93.4% | 14.0s | 121 |
More on FFmpeg and Grok
FFmpeg in other agents
Questions about FFmpeg in Grok
Can Grok use FFmpeg?
Yes. Add Spiral to Grok as an MCP server, and Grok can find and run FFmpeg like any built-in tool.
How much does FFmpeg cost in Grok?
$0.0013 per run, plus $0.00052 per second FFmpeg runs (whole seconds, at least one). Held at `max_seconds`, default 300. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Grok plan is separate.
Do I need a Spiral account to use FFmpeg in Grok?
No. Spiral runs FFmpeg on its own Spiral account. You sign in to Spiral once and never paste a key.
How long does it take to set up FFmpeg in Grok?
About two minutes: add a custom connector, then sign in to Spiral and approve, then check that it is connected.
Does Grok wait while FFmpeg runs?
FFmpeg runs in the background. Grok starts the run, checks on it and gives you the video, audio, image when it's ready.
What is FFmpeg useful for?
Use FFmpeg for concrete media edits: trim a recording, crop a frame, resize a video, convert formats, or join clips. Give the agent measurable instructions such as timestamps and output dimensions.
Which output resolutions can I request?
Specify dimensions such as 1280 × 720 or 1080 × 1920. State whether you want the picture resized or cropped, since those produce different compositions.
Can FFmpeg cut at an exact timestamp?
Transcoding supports accurate seeking by default. A cut made by copying streams can retain material before the requested start, so request re-encoding when the opening frame matters.
Can FFmpeg edit without losing quality?
Stream copying preserves the encoded quality when changing a compatible container or selecting streams. Cropping and resizing require decoded frames, so they cannot use stream copying.
Can I join clips with different encodings?
The concat demuxer requires matching codecs, time bases, and stream layouts. Ask the agent to check those properties and make the clips compatible before joining them.
Start using FFmpeg in Grok
One Spiral account for every tool your agent needs. No subscription; you pay per run.
Paste this into Grok:
set up https://spiral.ai/SKILL.md


