CommandsCreate a command
Commands

Create a command

Creates a new command.

curl -X POST "https://api.fetchmedia.io/v1/commands" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -d '{
  "ffmpeg_command": "ffmpeg -i {{in_1}} -c:v copy -c:a copy {{out_1}}",
  "ffmpeg_commands": [
    "ffmpeg -y -i {{in_1}} -c:v libx264 -b:v 2M -maxrate 3M -bufsize 1M -pass 1 -an -f mp4 /dev/null",
    "ffmpeg -i {{in_1}} -c:v libx264 -b:v 2M -maxrate 3M -bufsize 1M -pass 2 {{out_1}}"
  ],
  "input_files": {
    "in_1": "https://www3.cde.ca.gov/download/rod/big_buck_bunny.mp4"
  },
  "output_files": {
    "out_1": "output.mp4"
  },
  "webhook": "https://example.com/webhook"
}'
{
  "command_id": "123e4567-e89b-12d3-a456-426614174000"
}
POST
/commands
POST
Security Scheme
API Key (header: X-API-KEY)
X-API-KEYstring
Required

API key (sent in header)

Content-Typestring
Required

The media type of the request body

Options: application/json
ffmpeg_commandstring

The ffmpeg command to execute. mutually exclusive with ffmpeg_commands.

ffmpeg_commandsarray

Multiple ffmpeg commands to execute. mutually exclusive with ffmpeg_command.

input_filesobject

The input files to use for the command.

output_filesobject

The output files to use for the command.

webhookstring

The webhook to send the command payload once the job is completed.

Format: url
Request Preview
Response

Response will appear here after sending the request

Authentication

ApiKeyAuth
header
X-API-KEYstring
Required

API Key for authentication. Provide your API key in the header.

Body

application/json
ffmpeg_commandstring

The ffmpeg command to execute. mutually exclusive with ffmpeg_commands.

ffmpeg_commandsarray

Multiple ffmpeg commands to execute. mutually exclusive with ffmpeg_command.

input_filesobject

The input files to use for the command.

output_filesobject

The output files to use for the command.

webhookstring

The webhook to send the command payload once the job is completed.

Responses

Was this page helpful?
Built with Documentation.AI

Last updated today