{
  "openapi": "3.0.1",
  "info": {
    "title": "FFmpeg Video Converter & Compressor — MP4, MP3, GIF, WhatsApp",
    "description": "Convert and compress video and audio with FFmpeg: MP4, WebM, MOV, MP3, WAV, M4A, FLAC, GIF, thumbnails. Compress for WhatsApp, email, Discord or any size, 9:16 for Reels/TikTok, trim, mute, 16 kHz audio for Whisper. Links, uploads or datasets. For n8n, Make, Zapier.",
    "version": "1.0",
    "x-build-id": "Z3pDzQsoxygqUs0dc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tidydata~ffmpeg-video-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tidydata-ffmpeg-video-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/tidydata~ffmpeg-video-converter/runs": {
      "post": {
        "operationId": "runs-sync-tidydata-ffmpeg-video-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/tidydata~ffmpeg-video-converter/run-sync": {
      "post": {
        "operationId": "run-sync-tidydata-ffmpeg-video-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": {
          "fileUrls": {
            "title": "Video or audio links",
            "type": "array",
            "description": "One link per line: direct links to MP4, MOV, MKV, WebM, AVI, MP3, WAV, M4A… files, Google Drive / Dropbox / OneDrive share links, public Google Drive folders, archive.org, HLS (.m3u8) streams, or a web page that embeds a video file. YouTube, TikTok, Instagram, Facebook, X, Vimeo and their CDNs are refused (their terms forbid downloading). Only convert files you have the right to use.",
            "items": {
              "type": "string"
            }
          },
          "uploadedFiles": {
            "title": "Or upload files",
            "type": "array",
            "description": "Upload video or audio files from your computer (they go to a key-value store of your account and only this run reads them)."
          },
          "keyValueStoreId": {
            "title": "Or: files of a key-value store",
            "type": "string",
            "description": "Convert the video/audio files saved in one of your key-value stores (e.g. the output of another Actor). Only read access to this one store is requested."
          },
          "keyValueStoreKeys": {
            "title": "Only these keys of the store",
            "type": "array",
            "description": "Record keys to convert. Empty = every video or audio record of the store (up to 'Max files').",
            "items": {
              "type": "string"
            }
          },
          "preset": {
            "title": "What to do",
            "enum": [
              "mp4",
              "compress",
              "compress-whatsapp",
              "compress-email",
              "compress-discord",
              "compress-size",
              "resize",
              "vertical",
              "square",
              "landscape",
              "mute",
              "webm",
              "mov",
              "mkv",
              "mp3",
              "m4a",
              "wav",
              "flac",
              "ogg",
              "opus",
              "speech",
              "speech-wav",
              "gif",
              "thumbnail",
              "info"
            ],
            "type": "string",
            "description": "One action for all the files of the run. Compress presets fit the file under the size limit automatically (two-pass encoding, resolution lowered only when needed).",
            "default": "mp4"
          },
          "targetSizeMb": {
            "title": "Target size (MB)",
            "minimum": 1,
            "maximum": 4000,
            "type": "integer",
            "description": "For 'Compress to a target size': the output file will be under this size (e.g. 8, 25, 50)."
          },
          "resolution": {
            "title": "Resolution (max)",
            "enum": [
              "keep",
              "2160",
              "1440",
              "1080",
              "720",
              "480",
              "360",
              "240"
            ],
            "type": "string",
            "description": "Caps the short side of the video (works for vertical videos too). Never upscales. Also sets the size of thumbnails and of vertical/square/landscape frames.",
            "default": "keep"
          },
          "quality": {
            "title": "Video quality",
            "enum": [
              "high",
              "balanced",
              "small"
            ],
            "type": "string",
            "description": "For conversions without a size target (H.264 CRF 20 / 23 / 28).",
            "default": "balanced"
          },
          "fit": {
            "title": "Framing for 9:16, 1:1 and 16:9",
            "enum": [
              "blur",
              "crop",
              "pad"
            ],
            "type": "string",
            "description": "How a video that has another shape is placed into the vertical, square or landscape frame.",
            "default": "blur"
          },
          "maxFps": {
            "title": "Max frame rate",
            "minimum": 0,
            "maximum": 120,
            "type": "integer",
            "description": "Lower the frame rate (e.g. 30 or 24) to make files smaller. 0 or empty = keep."
          },
          "removeAudio": {
            "title": "Remove audio from the video",
            "type": "boolean",
            "description": "Same as the 'Remove audio' preset, but with any video preset (e.g. compress + mute).",
            "default": false
          },
          "startTime": {
            "title": "Start time (trim)",
            "type": "string",
            "description": "Cut the file: start here. Seconds (90), mm:ss (1:30), hh:mm:ss, 1m30s or a percent (10%). Empty = from the start."
          },
          "endTime": {
            "title": "End time (trim)",
            "type": "string",
            "description": "Cut the file: end here (same formats). Empty = to the end."
          },
          "normalizeAudio": {
            "title": "Normalize loudness",
            "type": "boolean",
            "description": "Even volume at -16 LUFS (EBU R128), good for podcasts, voice and social media. Always on for the AI transcription presets.",
            "default": false
          },
          "audioBitrateKbps": {
            "title": "Audio bitrate",
            "minimum": 0,
            "maximum": 512,
            "type": "integer",
            "description": "Empty = good defaults (MP3 192, AAC 160, Opus 128, speech 32)."
          },
          "gifMaxSeconds": {
            "title": "GIF: max length",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "GIFs are big: the first N seconds (after Start time) are used.",
            "default": 15
          },
          "gifWidth": {
            "title": "GIF: width",
            "minimum": 64,
            "maximum": 1280,
            "type": "integer",
            "description": "Never upscaled.",
            "default": 480
          },
          "gifFps": {
            "title": "GIF: frames per second",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Smoother GIFs need more frames per second, and get bigger.",
            "default": 12
          },
          "gifColors": {
            "title": "GIF: colors",
            "minimum": 16,
            "maximum": 256,
            "type": "integer",
            "description": "Fewer colors = smaller GIF.",
            "default": 128
          },
          "gifLoop": {
            "title": "GIF: loop forever",
            "type": "boolean",
            "description": "Off = plays once.",
            "default": true
          },
          "thumbnailTimes": {
            "title": "Thumbnail times",
            "type": "string",
            "description": "Comma separated: seconds, mm:ss or percents, e.g. '1, 50%, 2:30' (max 20). Each image is one 'image' event.",
            "default": "10%"
          },
          "datasetId": {
            "title": "Or: dataset with video links (chain another Actor)",
            "type": "string",
            "description": "A dataset from another run whose rows contain video or audio links. Only read access to this one dataset is requested."
          },
          "datasetUrlFields": {
            "title": "Dataset fields with the links",
            "type": "string",
            "description": "Field name(s), comma separated; nested paths work (media.url, videos.0.src). Empty = detect it (videoUrl, mediaUrl, url, fileUrl…)."
          },
          "maxFiles": {
            "title": "Max files",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many files (links, folder files and dataset rows together).",
            "default": 100
          },
          "maxFileSizeMb": {
            "title": "Max input file size",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Bigger files are not downloaded (free). Lowered automatically to what the run's disk can hold (it grows with memory).",
            "default": 2048
          },
          "maxMinutesPerFile": {
            "title": "Max minutes per file",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Longer files are refused before any work (free). Protects you from a costly surprise.",
            "default": 180
          },
          "maxSecondsPerFile": {
            "title": "Max time per file",
            "minimum": 60,
            "maximum": 86400,
            "type": "integer",
            "description": "FFmpeg is stopped after this time (the file is free). More memory = more CPU = faster.",
            "default": 3000
          },
          "maxConcurrency": {
            "title": "Files at the same time",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Downloads overlap with conversion. Keep 2 unless you give the run a lot of memory.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}