{
  "openapi": "3.0.1",
  "info": {
    "title": "Video & Audio Converter (FFmpeg): Compress, MP3, GIF, Frames",
    "description": "Video and audio converter (FFmpeg API): compress video to MP4/WebM or a target size, extract MP3/M4A/WAV, fast cut, GIFs, thumbnails, burn-in subtitles, media info, from links or datasets. $0.05 per video minute (720p), $0.003 per audio minute; failed files free.",
    "version": "0.1",
    "x-build-id": "lSzGeMqAwINtEWP2V"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kadben~video-audio-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kadben-video-audio-converter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/kadben~video-audio-converter/runs": {
      "post": {
        "operationId": "runs-sync-kadben-video-audio-converter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/kadben~video-audio-converter/run-sync": {
      "post": {
        "operationId": "run-sync-kadben-video-audio-converter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "files": {
            "title": "Files",
            "type": "array",
            "description": "Direct links to video or audio files you own or may process: MP4, MOV, WebM, MKV, AVI, MP3, M4A, WAV, FLAC, OGG and other formats FFmpeg reads. Dropbox and Google Drive share links are turned into download links. Pages of video platforms are not supported.",
            "items": {
              "type": "string"
            }
          },
          "datasets": {
            "title": "Datasets with file links",
            "type": "array",
            "description": "Optional: datasets whose rows hold file links, e.g. the output of Bulk File Downloader (field fileUrl) or of RSS Feed Reader (podcast enclosures). Picking a dataset gives this run read access to it only."
          },
          "fileFields": {
            "title": "File link fields",
            "type": "array",
            "description": "Fields of the dataset rows that hold the links: videoUrl, media.url, files.0, media.*.url (* = every item of a list). A field may hold one link, a list of links, or objects with a url, src, href or fileUrl key.",
            "default": [
              "url"
            ],
            "items": {
              "type": "string"
            }
          },
          "operation": {
            "title": "Operation",
            "enum": [
              "video",
              "audio",
              "cut",
              "gif",
              "frames",
              "probe"
            ],
            "type": "string",
            "description": "What to make from each file. 'Start' and 'End' below apply to every operation except Media info.",
            "default": "video"
          },
          "start": {
            "title": "Start",
            "type": "string",
            "description": "Optional: where to begin, as seconds (90) or a time (1:30, 01:02:03.5). Empty = the beginning."
          },
          "end": {
            "title": "End",
            "type": "string",
            "description": "Optional: where to stop, as seconds or a time. Empty = the end of the file (at most 'Max minutes per file' after 'Start')."
          },
          "videoFormat": {
            "title": "Video format",
            "enum": [
              "mp4",
              "webm"
            ],
            "type": "string",
            "description": "Output format of 'Convert or compress video'.",
            "default": "mp4"
          },
          "resolution": {
            "title": "Resolution",
            "enum": [
              "keep",
              "2160p",
              "1440p",
              "1080p",
              "720p",
              "480p",
              "360p",
              "240p"
            ],
            "type": "string",
            "description": "Shrink the shorter side to this size, keeping the aspect ratio (720p = 1280x720 landscape or 720x1280 portrait). Smaller videos are never enlarged. Price per minute by output size: up to 720p, up to 1080p, above 1080p; sources above 1080p cost at least the 1080p rate, and video above 30 fps counts each minute twice.",
            "default": "keep"
          },
          "quality": {
            "title": "Quality",
            "enum": [
              "high",
              "balanced",
              "small"
            ],
            "type": "string",
            "description": "Encoder quality when no 'Target size' is set (H.264 CRF 20 / 23 / 28, VP9 CRF 30 / 34 / 40).",
            "default": "balanced"
          },
          "targetSizeMb": {
            "title": "Target size",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Optional: aim the output at this size (1 MB = 1,048,576 bytes), e.g. 25 for e-mail or 16 for chat apps. The bitrate is set from the length (never above the source's bitrate, so a target bigger than the source does not inflate the file); if the file comes out bigger, it is encoded once more a little lower. 0 = off (use 'Quality').",
            "default": 0
          },
          "maxFps": {
            "title": "Max frame rate",
            "minimum": 0,
            "maximum": 120,
            "type": "integer",
            "description": "Optional: lower the frame rate to this value (e.g. 30 or 24). 0 = keep the source frame rate.",
            "default": 0
          },
          "mute": {
            "title": "Remove audio",
            "type": "boolean",
            "description": "Make a video without sound.",
            "default": false
          },
          "subtitlesUrl": {
            "title": "Burn-in subtitles",
            "type": "string",
            "description": "Optional: a direct link to an SRT or WebVTT file (e.g. from our Audio & Video Transcription Actor) to draw into the video. The times are read from the start of the source file; with 'Start' set they are shifted to match. Used with 'Convert or compress video' only."
          },
          "audioFormat": {
            "title": "Audio format",
            "enum": [
              "mp3",
              "m4a",
              "wav",
              "flac",
              "ogg"
            ],
            "type": "string",
            "description": "Output format of 'Extract or convert audio'.",
            "default": "mp3"
          },
          "audioKbps": {
            "title": "Audio bitrate",
            "minimum": 0,
            "maximum": 320,
            "type": "integer",
            "description": "Bitrate for MP3, M4A and OGG. 0 = default (MP3 192, M4A 160, OGG 128). MP3 at 16–24 kHz allows at most 160 kbps (8–12 kHz: 64), OGG (Opus) at most 256 kbps per channel. WAV and FLAC ignore it.",
            "default": 0
          },
          "channels": {
            "title": "Channels",
            "enum": [
              "keep",
              "mono",
              "stereo"
            ],
            "type": "string",
            "description": "Mono halves the size of speech recordings.",
            "default": "keep"
          },
          "sampleRate": {
            "title": "Sample rate",
            "enum": [
              "keep",
              "8000",
              "16000",
              "22050",
              "24000",
              "44100",
              "48000"
            ],
            "type": "string",
            "description": "Resample the audio. Opus (OGG) supports 8, 16, 24 and 48 kHz; other rates are encoded at 48 kHz.",
            "default": "keep"
          },
          "normalizeLoudness": {
            "title": "Normalize loudness",
            "type": "boolean",
            "description": "Even out the loudness to -16 LUFS (EBU R128; a common podcast level) with FFmpeg's loudnorm filter (one pass).",
            "default": false
          },
          "gifWidth": {
            "title": "GIF width",
            "minimum": 64,
            "maximum": 1280,
            "type": "integer",
            "description": "Width of the animated GIF (never wider than the video). GIFs use at most 30 seconds from 'Start'.",
            "default": 480
          },
          "gifFps": {
            "title": "GIF frame rate",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Frames per second of the GIF. 10-15 keeps files small.",
            "default": 10
          },
          "frameCount": {
            "title": "Number of frames",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Frames / thumbnails: this many images, evenly spaced over the part between 'Start' and 'End'. Ignored when 'Frame every N seconds' or 'Frame times' is set.",
            "default": 5
          },
          "frameEverySeconds": {
            "title": "Frame every N seconds",
            "minimum": 0,
            "maximum": 3600,
            "type": "integer",
            "description": "Optional: one image every N seconds instead (at most 300 per file). 0 = off.",
            "default": 0
          },
          "frameTimes": {
            "title": "Frame times",
            "type": "array",
            "description": "Optional: exact times for the images, e.g. 5, 1:30, 00:02:10.5 (up to 300). Overrides the two options above.",
            "items": {
              "type": "string"
            }
          },
          "frameFormat": {
            "title": "Frame format",
            "enum": [
              "jpg",
              "png",
              "webp"
            ],
            "type": "string",
            "description": "Image format of the frames.",
            "default": "jpg"
          },
          "frameWidth": {
            "title": "Frame width",
            "minimum": 0,
            "maximum": 7680,
            "type": "integer",
            "description": "Shrink frames to this width, keeping the aspect ratio. 0 = the video's size.",
            "default": 0
          },
          "maxFiles": {
            "title": "Max files",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop after this many unique links (up to 1,000 per run).",
            "default": 100
          },
          "maxMinutesPerFile": {
            "title": "Max minutes per file",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Process at most this many minutes of each file after 'Start'; the rest is left out (and not charged).",
            "default": 60
          },
          "maxFileSizeMb": {
            "title": "Max source size",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Bigger source files are not downloaded and are free. The run's disk is twice its memory and holds the source and the output of every file in progress, so fewer files run at once when this is high (at the default 4 GB and 1,024 MB the disk allows 3 at a time; 'Max concurrency' sets how many run). For bigger files give the run more memory; 4 GB fits a single source of about 3.2 GB. Give 4K video 4 GB or more.",
            "default": 1024
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Files processed at once, lowered so that they fit the run's disk (see 'Max source size'); at most 2 downloads from one site. FFmpeg runs up to one process per full CPU core and never more than the files in progress; a single file gets all cores as threads, so more memory brings more CPU.",
            "default": 2
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}