# List the containers and codecs this server can produce

> H.264 and H.265 come from x264 and x265, which are GPL-only, so an ffmpeg built without GPL support has neither. gpl_build says which build this is, and codecs lists what can actually be encoded.

Source: https://tools.vukem.dev/docs/api/tools.video-convert.capabilities/

## Authentication

No key is needed. This route is public.

## Responses

### 200 OK

Content type `application/json`. Schema: [`VideoCapabilities`](/docs/api/schemas#videocapabilities).

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `codecs` | array of `string` | - | The video codecs this server can encode. An ffmpeg built without GPL support has no H.264 or H.265 |
| `containers` | array of [`VideoContainer`](/docs/api/schemas#videocontainer) | - | Every output container, with the codecs it carries |
| `dithers` | array of `string` | - | The dithering modes video-to-gif accepts |
| `gpl_build` | `boolean` | - | Whether the video engine is built with GPL support, which H.264 and H.265 require |
| `max_gif_seconds` | `number (double)` | - | The longest range video-to-gif will convert, in seconds |
| `max_seconds` | `number (double)` | - | The longest video this server converts, in seconds |

### Any other status

Content type `application/problem+json`. Error (RFC 9457 problem details). Schema: [`Problem`](/docs/api/schemas#problem).

The error follows RFC 9457. See [Errors](/docs/api/overview#errors).

```bash
curl -X GET "http://localhost:3000/api/v1/tools/video-convert/capabilities"
```

```python
import requests

response = requests.get(
    "http://localhost:3000/api/v1/tools/video-convert/capabilities",
    timeout=30,
)
response.raise_for_status()
print(response.json())
```

```javascript
const response = await fetch("http://localhost:3000/api/v1/tools/video-convert/capabilities", {
  method: "GET",
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
console.log(await response.json());
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	url := "http://localhost:3000/api/v1/tools/video-convert/capabilities"
	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		panic(err)
	}

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, err := io.ReadAll(res.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(res.Status, string(out))
}
```

```php
<?php

$ch = curl_init("http://localhost:3000/api/v1/tools/video-convert/capabilities");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_RETURNTRANSFER => true,
]);

$response = curl_exec($ch);
if ($response === false) {
    throw new RuntimeException(curl_error($ch));
}
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;
```

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("http://localhost:3000/api/v1/tools/video-convert/capabilities"))
            .GET()
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.statusCode() + " " + response.body());
    }
}
```

```csharp
using System;
using System.Net.Http;

using var client = new HttpClient();
using var request = new HttpRequestMessage(
    HttpMethod.Get, "http://localhost:3000/api/v1/tools/video-convert/capabilities");

using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```

```ruby
require "net/http"
require "uri"

uri = URI("http://localhost:3000/api/v1/tools/video-convert/capabilities")
request = Net::HTTP::Get.new(uri)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
puts "#{response.code} #{response.body}"
```

**Response examples**

```json
{
  "codecs": [
    "h264",
    "h265",
    "vp9",
    "av1"
  ],
  "containers": [
    {
      "audio_codecs": [
        "aac",
        "mp3",
        "copy",
        "mute"
      ],
      "extension": ".mp4",
      "label": "MP4",
      "name": "mp4",
      "video_codecs": [
        "h264",
        "h265",
        "av1"
      ]
    },
    {
      "audio_codecs": [
        "opus",
        "vorbis",
        "copy",
        "mute"
      ],
      "extension": ".webm",
      "label": "WebM",
      "name": "webm",
      "video_codecs": [
        "vp9",
        "av1"
      ]
    }
  ],
  "dithers": [
    "none",
    "bayer",
    "heckbert",
    "floyd_steinberg",
    "sierra2",
    "sierra2_4a",
    "sierra3",
    "burkes",
    "atkinson"
  ],
  "gpl_build": true,
  "max_gif_seconds": 15,
  "max_seconds": 7200
}
```

The examples are built from the schemas, so every value is a placeholder of its type. The tables above hold the fields that carry the real values.
