{
  "id": "ffmpeg",
  "name": "FFmpeg",
  "homepage": "https://ffmpeg.org",
  "description": "A complete, cross-platform solution to record, convert and stream audio and video.",
  "icon": "SimpleIcons:ffmpeg",
  "executables": [
    "ffmpeg"
  ],
  "dotfiles": {
    "paths": [
      "~/.ffmpeg/"
    ],
    "secret": [],
    "side_effect": false
  },
  "commands": {
    "format": 1,
    "label": "Convert media",
    "description": "Convert or trim one input into one output file. Filter graphs, stream mapping, multiple inputs, hardware acceleration and streaming are left out.",
    "quality": "ai-draft",
    "base": "fig:ffmpeg",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": false,
      "short_attached": false,
      "short_bundles": false
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/ffmpeg.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "input",
        "label": "Input file",
        "type": "path",
        "option": [
          "-i"
        ],
        "path": {
          "kind": "file",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "overwrite",
        "label": "Overwrite output",
        "description": "Overwrite the output file without asking.",
        "type": "boolean",
        "option": [
          "-y"
        ],
        "effect": "overwrite",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "start",
        "label": "Start time",
        "description": "Offset into the input, for example 00:01:30 or 90.",
        "type": "string",
        "option": [
          "-ss"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "duration",
        "label": "Duration",
        "description": "Seconds or HH:MM:SS to process.",
        "type": "string",
        "option": [
          "-t"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "video_codec",
        "label": "Video codec",
        "type": "string",
        "option": [
          "-vcodec"
        ],
        "suggestions": [
          {
            "value": "libx264",
            "label": "H.264"
          },
          {
            "value": "libx265",
            "label": "H.265"
          },
          {
            "value": "copy",
            "label": "Copy stream"
          }
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "audio_codec",
        "label": "Audio codec",
        "type": "string",
        "option": [
          "-acodec"
        ],
        "suggestions": [
          {
            "value": "aac",
            "label": "AAC"
          },
          {
            "value": "libmp3lame",
            "label": "MP3"
          },
          {
            "value": "copy",
            "label": "Copy stream"
          }
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "video_filter",
        "label": "Video filter",
        "description": "For example scale=1280:-2.",
        "type": "string",
        "option": [
          "-vf"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "video_bitrate",
        "label": "Video bitrate",
        "description": "For example 2M.",
        "type": "string",
        "option": [
          "-b"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "frame_rate",
        "label": "Frame rate",
        "type": "number",
        "option": [
          "-r"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "sample_rate",
        "label": "Audio sample rate (Hz)",
        "type": "integer",
        "option": [
          "-ar"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "no_audio",
        "label": "Drop audio",
        "type": "boolean",
        "option": [
          "-an"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "no_video",
        "label": "Drop video",
        "type": "boolean",
        "option": [
          "-vn"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "output",
        "label": "Output file",
        "description": "The extension chooses the container format.",
        "type": "path",
        "position": 0,
        "path": {
          "kind": "file",
          "role": "output",
          "must_exist": false
        },
        "effect": "overwrite",
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "convert",
        "label": "Convert video",
        "fields": [
          "input",
          "video_codec",
          "audio_codec",
          "output",
          "overwrite"
        ],
        "required": [
          "input",
          "output"
        ]
      },
      {
        "id": "extract-audio",
        "label": "Extract audio",
        "set": {
          "no_video": [
            true
          ]
        },
        "fields": [
          "input",
          "no_video",
          "audio_codec",
          "output"
        ],
        "required": [
          "input",
          "output"
        ]
      },
      {
        "id": "trim",
        "label": "Trim without re-encoding",
        "set": {
          "video_codec": [
            "copy"
          ],
          "audio_codec": [
            "copy"
          ]
        },
        "fields": [
          "input",
          "start",
          "duration",
          "video_codec",
          "audio_codec",
          "output"
        ],
        "required": [
          "input",
          "output"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "input",
          "output",
          "overwrite",
          "start",
          "duration",
          "video_codec",
          "audio_codec"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "video_filter",
          "video_bitrate",
          "frame_rate",
          "sample_rate",
          "no_audio",
          "no_video"
        ]
      }
    ]
  }
}
