---
title: "VideoSplit"
language: "en"
type: "Symbol"
summary: "VideoSplit[video, t] splits video at time t. VideoSplit[video, {t1, t2, ...}] splits video at times ti."
keywords: 
- video split
- video splitter
- video positions
- video partitions
- video scenes
- video selection
- video intervals
canonical_url: "https://reference.wolfram.com/language/ref/VideoSplit.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Video Computation: Update History"
    link: "https://reference.wolfram.com/language/guide/VideoComputation-UpdateHistory.en.md"
  - 
    title: "Video Editing"
    link: "https://reference.wolfram.com/language/guide/VideoEditing.en.md"
related_functions: 
  - 
    title: "VideoTrim"
    link: "https://reference.wolfram.com/language/ref/VideoTrim.en.md"
  - 
    title: "VideoJoin"
    link: "https://reference.wolfram.com/language/ref/VideoJoin.en.md"
  - 
    title: "VideoDelete"
    link: "https://reference.wolfram.com/language/ref/VideoDelete.en.md"
  - 
    title: "VideoCombine"
    link: "https://reference.wolfram.com/language/ref/VideoCombine.en.md"
  - 
    title: "VideoIntervals"
    link: "https://reference.wolfram.com/language/ref/VideoIntervals.en.md"
---
[EXPERIMENTAL]

# VideoSplit

VideoSplit[video, t] splits video at time t.

VideoSplit[video, {t1, t2, …}] splits video at times ti.

## Details and Options

* ``VideoSplit`` can be used to split a video into video segments such as video scenes.

[image]

* The times ``ti`` can be any of the following:

|                       |                                              |
| --------------------- | -------------------------------------------- |
| t                     | time given in seconds                        |
| Quantity[t, "unit"]   | time given in "unit" compatible with seconds |
| Quantity[t, "Frames"] | time given as number of frames               |

* By default, ``VideoSplit`` places the new videos under the ``"Video"`` directory in ``\$WolframDocumentsDirectory``.

* The following options can be specified:

|                         |                          |                                                             |
| ----------------------- | ------------------------ | ----------------------------------------------------------- |
| AudioEncoding           | Automatic                | audio encoding to use                                       |
| CompressionLevel        | Automatic                | compression level to use                                    |
| GeneratedAssetFormat    | Automatic                | the file format of the result                               |
| GeneratedAssetLocation  | \$GeneratedAssetLocation | the location of the result                                  |
| OverwriteTarget         | False                    | whether to overwrite an existing file                       |
| SubtitleEncoding        | Automatic                | subtitle encoding to use                                    |
| VideoEncoding           | Automatic                | video encoding to use                                       |
| VideoTransparency       | False                    | whether the output video should have a transparency channel |

---

## Examples (17)

### Basic Examples (1)

Split a video into two segments:

```wl
In[1]:= v = Video["ExampleData/bullfinch.mkv"];

In[2]:= VideoSplit[v, 5]

Out[2]= [image]
```

### Scope (6)

Split at a time 5 seconds into the video:

```wl
In[1]:=
v = Video["ExampleData/bullfinch.mkv"];
Duration[v]

Out[1]= Quantity[15.022, "Seconds"]

In[2]:= VideoSplit[v, 5]

Out[2]= [image]

In[3]:= Duration[%]

Out[3]= {Quantity[5.042, "Seconds"], Quantity[10.054, "Seconds"]}
```

---

Split at a time 5 seconds from the end of the video:

```wl
In[1]:= VideoSplit[Video["ExampleData/bullfinch.mkv"], -5]

Out[1]= [image]

In[2]:= Duration[%]

Out[2]= {Quantity[10.036, "Seconds"], Quantity[4.99, "Seconds"]}
```

---

Split a video after the first 5 frames:

```wl
In[1]:=
v = Video["ExampleData/bullfinch.mkv"];
Information[v, "FrameCount"]

Out[1]= <|1 -> 433|>

In[2]:= VideoSplit[Video["ExampleData/bullfinch.mkv"], Quantity[5, "Frames"]]

In[3]:= [image]

In[4]:= Information[#, "FrameCount"]& /@ %

Out[4]= {<|1 -> 5|>, <|1 -> 428|>}
```

---

Split a video before the last 5 frames:

```wl
In[1]:=
v = Video["ExampleData/bullfinch.mkv"];
Information[v, "FrameCount"]

Out[1]= <|1 -> 433|>

In[2]:= VideoSplit[Video["ExampleData/bullfinch.mkv"], Quantity[-5, "Frames"]]

Out[2]= [image]

In[3]:= Information[#, "FrameCount"]& /@ %

Out[3]= {<|1 -> 428|>, <|1 -> 5|>}
```

---

Partition a video into multiple segments:

```wl
In[1]:= VideoSplit[Video["ExampleData/bullfinch.mkv"], {2, 7}]

Out[1]= [image]

In[2]:= Duration[%]

Out[2]= {Quantity[2.007, "Seconds"], Quantity[5.033, "Seconds"], Quantity[8.032, "Seconds"]}
```

---

Split using a valid time ``Quantity`` :

```wl
In[1]:= VideoSplit[Video["ExampleData/bullfinch.mkv"], Quantity[6, "Seconds"]]

Out[1]= [image]

In[2]:= Duration[%]

Out[2]= {Quantity[6.006, "Seconds"], Quantity[9.005, "Seconds"]}
```

### Options (4)

#### CompressionLevel (1)

Specify a compression level to use for all generated segments:

```wl
In[1]:=
v = Video["ExampleData/bullfinch.mkv"];
FileSize[FindFile@Information[v, "ResourcePath"]]

Out[1]= Quantity[2.391515, "Megabytes"]
```

Use minimal compression:

```wl
In[2]:=
segments = VideoSplit[v, 4, CompressionLevel -> 0, IconizedObject[«encoding»]];
Total[FileSize[Information[#, "ResourcePath"]]& /@ segments]

Out[2]= Quantity[24.915928, "Megabytes"]
```

Use maximal compression:

```wl
In[3]:=
segments = VideoSplit[v, 4, CompressionLevel -> 1, IconizedObject[«encoding»]];
Total[FileSize[Information[#, "ResourcePath"]]& /@ segments]

Out[3]= Quantity[617.892, "Kilobytes"]
```

#### GeneratedAssetFormat (1)

Use ``GeneratedAssetFormat`` to change the format of the generated segments:

```wl
In[1]:=
v = Video["ExampleData/rule30.mp4"];
FileFormat[Information[v, "ResourcePath"]]

Out[1]= "MP4"

In[2]:= VideoSplit[v, 1, GeneratedAssetFormat -> "QuickTime"]

Out[2]= {\!\(\*VideoBox[...]\), \!\(\*VideoBox[...]\)}

In[3]:= FileFormat[Information[#, "ResourcePath"]]& /@ %

Out[3]= {"QuickTime", "QuickTime"}
```

#### GeneratedAssetLocation (1)

Specify a directory in which to store all generated segments:

```wl
In[1]:= dir = CreateDirectory[];

In[2]:= v = Video["ExampleData/rule30.mp4"];

In[3]:= VideoSplit[v, 1, GeneratedAssetLocation -> dir]

Out[3]= {\!\(\*VideoBox[...]\), \!\(\*VideoBox[...]\)}
```

#### VideoEncoding (1)

Specify a video encoding to use for all generated segments:

```wl
In[1]:=
v = Video["ExampleData/bullfinch.mkv"];
Import[Information[v, "ResourcePath"], "VideoEncoding"]

Out[1]= "VP9"

In[2]:= segments = VideoSplit[v, 4, VideoEncoding -> "H264"];

In[3]:= Import[Information[#, "ResourcePath"], "VideoEncoding"]& /@ segments

Out[3]= {"H264", "H264"}
```

### Applications (1)

Split a video into scenes:

```wl
In[1]:= v = Video["ExampleData/Caminandes.mp4"];
```

Find positions in the video where the difference between consecutive frames is large:

```wl
In[2]:= pos = Last /@ VideoIntervals[v, Mean@Mean[ImageDifference@@#Image] > .3&, 2, 1]

Out[2]= {48.5, 51.3333, 63.7083, 76.125, 76.375, 81.125, 82.9167, 86.2917}
```

Split at those positions:

```wl
In[3]:= scenes = VideoSplit[v, pos]

Out[3]= [image]
```

### Properties & Relations (3)

If the requested time is beyond the duration of the video, only the available data is returned:

```wl
In[1]:=
v = Video["ExampleData/bullfinch.mkv"];
Duration[v]

Out[1]= Quantity[15.003, "Seconds"]

In[2]:= VideoSplit[v, 50]//Duration

Out[2]= {Quantity[15.003, "Seconds"]}
```

Negative times are also clipped to 0:

```wl
In[3]:= VideoSplit[v, -50]//Duration

Out[3]= {Quantity[15.003, "Seconds"]}
```

---

Properties of the original video object are typically preserved:

```wl
In[1]:=
v = Video["ExampleData/bullfinch.mkv"];
Information[v]

Out[1]=
InformationData[Association["ObjectType" -> "Video", "Duration" -> Quantity[15.022, "Seconds"], 
  "RasterSize" -> Automatic, "BitRate" -> Quantity[1258241, "Bits"/"Seconds"], 
  "VideoTracks" -> Dataset[Association[1 -> Association["OriginalRaster ... deoUtilitiesDump`x_, 
            Video`VideoUtilitiesDump`rest___]] :> Quantity[NumberForm[
            N[Video`VideoUtilitiesDump`x], {10, 2}], Video`VideoUtilitiesDump`rest]] & )]], 
  "ResourcePath" -> File["ExampleData/bullfinch.mkv"]], True]
```

Compare with the properties of the first video segment:

```wl
In[2]:=
segments = VideoSplit[v, 5];
Information[segments[[1]]]

Out[2]=
InformationData[Association["ObjectType" -> "Video", "Duration" -> Quantity[5., "Seconds"], 
  "RasterSize" -> Automatic, "BitRate" -> Quantity[4506630, "Bits"/"Seconds"], 
  "VideoTracks" -> Dataset[Association[1 -> Association["OriginalRasterSize ... esDump`rest___]] :> Quantity[NumberForm[
            N[Video`VideoUtilitiesDump`x], {10, 2}], Video`VideoUtilitiesDump`rest]] & )]], 
  "ResourcePath" -> 
   File["/Users/generic/Documents/Wolfram/Video/VideoSplit-2025-06-26T17-42-00.mp4"]], True]
```

---

Divide a video into segments using ``VideoSplit`` :

```wl
In[1]:= v = Video["ExampleData/bullfinch.mkv"];

In[2]:= VideoSplit[v, Quantity[7.5015, "Seconds"]]//Duration

Out[2]= {Quantity[7.508, "Seconds"], Quantity[7.526, "Seconds"]}
```

Divide a video into segments using ``VideoTrim`` :

```wl
In[3]:= VideoTrim[v, {{0, Quantity[7.5015, "Seconds"]}, {Quantity[7.5015, "Seconds"], Duration[v]}}]//Duration

Out[3]= {Quantity[7.508, "Seconds"], Quantity[7.526, "Seconds"]}
```

### Possible Issues (2)

Due to the nature of video encoding, the total duration of the segments may not add up exactly to the duration of the original video:

```wl
In[1]:=
v = Video["ExampleData/bullfinch.mkv"];
Duration[v]

Out[1]= Quantity[15.003, "Seconds"]

In[2]:= Total[Duration[VideoSplit[v, 5]]]

Out[2]= Quantity[15.043000000000001, "Seconds"]
```

---

If the specified split time does not reflect an exact frame boundary, the same frame may be included in both resulting segments:

```wl
In[1]:= v = VideoGenerator[ImageCrop[Rasterize[Style[#, Hue[#]], ImageSize -> {50, 50}], {50, 50}, Padding -> 1]&, Quantity[5, "Frames"], FrameRate -> 5];

In[2]:= VideoExtractFrames[#, All]& /@ VideoSplit[v, .3]

Out[2]= {{[image], [image]}, {[image], [image], [image], [image]}}
```

Specifying a frame number at which to split will generally give a discrete result:

```wl
In[3]:= VideoExtractFrames[#, All]& /@ VideoSplit[v, Quantity[2, "Frames"]]

Out[3]= {{[image], [image]}, {[image], [image], [image]}}
```

## See Also

* [`VideoTrim`](https://reference.wolfram.com/language/ref/VideoTrim.en.md)
* [`VideoJoin`](https://reference.wolfram.com/language/ref/VideoJoin.en.md)
* [`VideoDelete`](https://reference.wolfram.com/language/ref/VideoDelete.en.md)
* [`VideoCombine`](https://reference.wolfram.com/language/ref/VideoCombine.en.md)
* [`VideoIntervals`](https://reference.wolfram.com/language/ref/VideoIntervals.en.md)

## Related Guides

* [Video Computation: Update History](https://reference.wolfram.com/language/guide/VideoComputation-UpdateHistory.en.md)
* [Video Editing](https://reference.wolfram.com/language/guide/VideoEditing.en.md)

## History

* [Introduced in 2020 (12.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn122.en.md) \| [Updated in 2021 (12.3)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn123.en.md)