> This page is for version 0.2.0 (Latest) (default).
> For other versions, use one of these documentation indexes:
> - 0.2.0 (Latest) (default): https://docs.nvidia.com/nim/computer-vision/semantic-split/0.2.0/llms.txt
> - 0.1.0: https://docs.nvidia.com/nim/computer-vision/semantic-split/0.1.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nim/computer-vision/semantic-split/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nim/computer-vision/semantic-split/_mcp/server.

# Runs the splitting pipeline on a video.

POST /video_split
Content-Type: application/json

Runs the splitting pipeline on a video.

Reference: https://docs.nvidia.com/nim/computer-vision/semantic-split/api-reference/video-splitting/video-split-post

## Request

### Body (application/json)

This endpoint expects a VideoSplitRequest.

- `input_paths` (list of string, required) — The list of either server accessible or remote S3 video paths that you want to run the splitting pipeline on . No mix and match in the path format is allowed.
- `results_dir` (string, required) — Either a server accessible directory or remote S3 path where the results should be written.

## Response

### 200

Successful Response

- `total_frames_processed` (integer, required) — Total number of video frames processed so far. This is a sumof all the frames processed from all input videos.
- `total_output_frames` (integer, required) — Total number of output frames generated so far. This is a sumof all the frames generated for all the output clips.
- `results` (map from string to VideoSplitResult, required) — A dictionary with the video paths as key and their pipeline results as the value.

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 500 Internal Server Error

Any Internal Server Error

- `message` (string, required) — Detailed error message.

## Types

### VideoSplitResult

Represents the splitting results of a video.

- `num_clips` (integer, required) — Number of clips extracted from the video.
- `clips` (list of ClipInfo, required) — Information about each clip.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ClipInfo

Represents the various information related to a clip.

- `span` (ClipSpan, required) — Span for the clip in terms of start and end frames.
- `path` (string, required) — Path specifying where this clip is stored on the disk.

### ValidationErrorLocItems

- string
- integer

### ClipSpan

Represents the span of the clip in terms of its start and end frames from a video.

- `start_frame_idx` (integer, required) — The index of frame that marks the beginning of this clip from a video.
- `end_frame_idx` (integer, required) — The index of frame that marks the end of this clip from a video.

## Examples

**Request**

```json
{
  "input_paths": [
    "s3://video_data/video_1.mp4",
    "s3://video_data/video_2.mp4"
  ],
  "results_dir": "s3://video_data_output"
}
```

**Response**

```json
{
  "total_frames_processed": 1,
  "total_output_frames": 1,
  "results": {}
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/video_split"

payload = {
    "input_paths": ["s3://video_data/video_1.mp4", "s3://video_data/video_2.mp4"],
    "results_dir": "s3://video_data_output"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/video_split';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"input_paths":["s3://video_data/video_1.mp4","s3://video_data/video_2.mp4"],"results_dir":"s3://video_data_output"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.example.com/video_split"

	payload := strings.NewReader("{\n  \"input_paths\": [\n    \"s3://video_data/video_1.mp4\",\n    \"s3://video_data/video_2.mp4\"\n  ],\n  \"results_dir\": \"s3://video_data_output\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/video_split")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"input_paths\": [\n    \"s3://video_data/video_1.mp4\",\n    \"s3://video_data/video_2.mp4\"\n  ],\n  \"results_dir\": \"s3://video_data_output\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/video_split")
  .header("Content-Type", "application/json")
  .body("{\n  \"input_paths\": [\n    \"s3://video_data/video_1.mp4\",\n    \"s3://video_data/video_2.mp4\"\n  ],\n  \"results_dir\": \"s3://video_data_output\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/video_split', [
  'body' => '{
  "input_paths": [
    "s3://video_data/video_1.mp4",
    "s3://video_data/video_2.mp4"
  ],
  "results_dir": "s3://video_data_output"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/video_split");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"input_paths\": [\n    \"s3://video_data/video_1.mp4\",\n    \"s3://video_data/video_2.mp4\"\n  ],\n  \"results_dir\": \"s3://video_data_output\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "input_paths": ["s3://video_data/video_1.mp4", "s3://video_data/video_2.mp4"],
  "results_dir": "s3://video_data_output"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/video_split")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```