---
title: "VideoCombine"
language: "en"
type: "Symbol"
summary: "VideoCombine[{obj1, obj2, ...}] creates a multi-track video by combining all audio, video and subtitle tracks in all obji."
keywords: 
- video combine
- combine video tracks
- video plus audio
- add audio to video
- add audio tracks
canonical_url: "https://reference.wolfram.com/language/ref/VideoCombine.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"
---
[EXPERIMENTAL]

# VideoCombine

VideoCombine[{obj1, obj2, …}] creates a multi-track video by combining all audio, video and subtitle tracks in all obji.

## Details and Options

* ``VideoCombine`` is typically used to combine a video track and an audio track or to add additional audio or subtitle tracks.

[image]

* Possible objects ``obji`` can be any of the following:

|          |                        |
| -------- | ---------------------- |
| audio    | an Audio object        |
| image    | an Image object        |
| video    | a Video object         |
| subtitle | subtitle specification |

* Subtitles can be given in any of the following forms:

|                   |                                                |
| ----------------- | ---------------------------------------------- |
| string            | a single string                                |
| Text[…]           | positioned and/or styled text                  |
| {text1, text2, …} | show texti in a uniformly distributed sequence |
| {t1 -> text1, …}   | show each texti at the time interval ti        |
| rawSubtitles      | raw subtitles                                  |

* By default, all tracks of ``Video`` objects ``obji`` are included in the resulting video.

* By default, ``VideoCombine`` places the new video 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 | location of the generated asset                             |
| OverwriteTarget         | Automatic                | whether to overwrite an existing file                       |
| ShowSubtitles           | True                     | whether to display the subtitle tracks                      |
| SubtitleEncoding        | Automatic                | subtitle encoding to use                                    |
| SubtitleStyle           | {}                       | subtitle style to use                                       |
| VideoEncoding           | Automatic                | video encoding to use                                       |
| VideoTransparency       | False                    | whether the output video should have a transparency channel |

---

## Examples (14)

### Basic Examples (2)

Generate a video with no audio:

```wl
In[1]:= v = AnimationVideo[LinearGradientImage[Hue[t], {200, 100}], {t, 0, 1}]

Out[1]= \!\(\*VideoBox["![Embedded Video Player](video://content-6nlv9)"]\)
```

Combine the video with an audio object:

```wl
In[2]:= VideoCombine[{v, ExampleData[{"Audio", "Drums"}]}]

Out[2]= \!\(\*VideoBox["![Embedded Video Player](video://content-bnhm5)"]\)
```

Check the properties of the final video:

```wl
In[3]:= Information[%]

Out[3]=
InformationData[Association["ObjectType" -> "Video", "Duration" -> Quantity[5.033, "Seconds"], 
  "RasterSize" -> Automatic, "BitRate" -> Quantity[156843, "Bits"/"Seconds"], 
  "VideoTracks" -> Dataset[Association[1 -> Association["OriginalRasterSi ... iesDump`rest___]] :> Quantity[NumberForm[
            N[Video`VideoUtilitiesDump`x], {10, 2}], Video`VideoUtilitiesDump`rest]] & )]], 
  "ResourcePath" -> 
   File["/Users/user/Documents/Wolfram/Video/VideoCombine-2023-08-03T13-52-07.mp4"]], True]
```

---

Add some text as subtitles:

```wl
In[1]:= v = AnimationVideo[LinearGradientImage[Hue[t], {200, 100}], {t, 0, 1}];

In[2]:= VideoCombine[{v, {"Hello", "this is my subtitle"}}]

Out[2]= \!\(\*VideoBox["![Embedded Video Player](video://content-ahmpx)"]\)
```

### Scope (4)

Combine an image and an audio track:

```wl
In[1]:= v = VideoCombine[{RandomImage[], Audio["ExampleData/rule30.wav"]}]

Out[1]= \!\(\*VideoBox["![Embedded Video Player](video://content-1stn0)"]\)

In[2]:= Information[v]

Out[2]=
InformationData[Association["ObjectType" -> "Video", "Duration" -> Quantity[1.8, "Seconds"], 
  "RasterSize" -> Automatic, "BitRate" -> Quantity[788075, "Bits"/"Seconds"], 
  "VideoTracks" -> Dataset[Association[1 -> Association["OriginalRasterSize ... iesDump`rest___]] :> Quantity[NumberForm[
            N[Video`VideoUtilitiesDump`x], {10, 2}], Video`VideoUtilitiesDump`rest]] & )]], 
  "ResourcePath" -> 
   File["/Users/user/Documents/Wolfram/Video/VideoCombine-2024-10-30T18-29-24.mp4"]], True]
```

---

Combine two video tracks into a single video:

```wl
In[1]:= v = VideoCombine[{VideoGenerator[RandomImage[]], VideoGenerator[RandomImage[1, 500]]}]

Out[1]= \!\(\*VideoBox["![Embedded Video Player](video://content-ckn31)"]\)

In[2]:= Information[v, "VideoTracks"]

Out[2]=
Dataset[Association[1 -> Association["OriginalRasterSize" -> {150, 150}, "VideoEncoding" -> "H264", 
    "BitDepth" -> 8, "ColorSpace" -> "RGB", "FrameRate" -> Quantity[30, "Frames"/"Seconds"]], 
  2 -> Association["OriginalRasterSize" -> {500, 500}, "VideoEncoding" -> "H264", "BitDepth" -> 8, 
    "ColorSpace" -> "RGB", "FrameRate" -> Quantity[30, "Frames"/"Seconds"]]]]
```

---

Combine two ``Video`` objects with video, audio and subtitle tracks:

```wl
In[1]:=
v1 = Video["ExampleData/bullfinch.mkv"];
v2 = Video["ExampleData/fish.mp4"];

In[2]:= v = VideoCombine[{v1, v2}]

Out[2]= \!\(\*VideoBox["![Embedded Video Player](video://content-72tzj)"]\)

In[3]:= Information[%%]

Out[3]=
InformationData[Association["ObjectType" -> "Video", "Duration" -> Quantity[15.021, "Seconds"], 
  "RasterSize" -> Automatic, "BitRate" -> Quantity[1368337, "Bits"/"Seconds"], 
  "VideoTracks" -> Dataset[Association[1 -> Association["OriginalRaster ... iesDump`rest___]] :> Quantity[NumberForm[
            N[Video`VideoUtilitiesDump`x], {10, 2}], Video`VideoUtilitiesDump`rest]] & )]], 
  "ResourcePath" -> 
   File["/Users/user/Documents/Wolfram/Video/VideoCombine-2024-12-19T14-08-11.mp4"]], True]
```

---

If a video has multiple tracks, use the track selection options to select which tracks to combine:

```wl
In[1]:= v = VideoCombine[{Video["ExampleData/bullfinch.mkv", AudioTrackSelection -> 3], Video["ExampleData/bullfinch.mkv", AudioTrackSelection -> 1]}]

Out[1]= \!\(\*VideoBox["![Embedded Video Player](video://content-ismps)"]\)

In[2]:= Information[v, "AudioTracks"]

Out[2]=
Dataset[Association[1 -> Association["AudioEncoding" -> "VORBIS", "AudioChannels" -> 1, 
    "AudioBitDepth" -> 32, "SampleRate" -> Quantity[44100, "Samples"/"Seconds"]], 
  2 -> Association["AudioEncoding" -> "VORBIS", "AudioChannels" -> 2, "AudioBitDepth" -> 32, 
    "SampleRate" -> Quantity[48000, "Samples"/"Seconds"]]]]
```

### Options (5)

#### GeneratedAssetLocation (2)

Assets are automatically generated in the ``"Video"`` folder within ``\$WolframDocumentsDirectory`` :

```wl
In[1]:= Information[VideoCombine[{Video["ExampleData/bullfinch.mkv"], ExampleData[{"Audio", "PianoScale"}]}], "ResourcePath"]

Out[1]= File["/Users/user/Documents/Wolfram/Video/VideoCombine-b4d757f7-9808-4212-93da-643fa6a074d4.mkv"]
```

Specify the location of the asset created by ``VideoGenerator`` :

```wl
In[2]:=
v = VideoCombine[{Video["ExampleData/bullfinch.mkv"], ExampleData[{"Audio", "PianoScale"}]}, GeneratedAssetLocation -> "file.mp4"];
Information[v, "ResourcePath"]

Out[2]= File["file.mp4"]
```

---

Use a ``LocalObject`` as the asset for the resulting ``Video`` object:

```wl
In[1]:=
v = VideoCombine[{Video["ExampleData/bullfinch.mkv"], ExampleData[{"Audio", "PianoScale"}]}, GeneratedAssetLocation -> LocalObject[]];
Information[v, "ResourcePath"]

Out[1]= LocalObject["file:///Users/user/Library/Wolfram/Objects/5741c499-b6ef-4c4c-884a-d86db458f1f7"]
```

#### OverwriteTarget (1)

By default, if a file already exists it is not overwritten:

```wl
In[1]:= VideoCombine[{Video["ExampleData/bullfinch.mkv"], ExampleData[{"Audio", "PianoScale"}]}, GeneratedAssetLocation -> "file.mp4"];
```

VideoCombine::filex: file.mp4 already exists.

Use ``OverwriteTarget -> True`` to overwrite an existing file:

```wl
In[2]:=
v = VideoCombine[{Video["ExampleData/bullfinch.mkv"], ExampleData[{"Audio", "PianoScale"}]}, GeneratedAssetLocation -> "file.mp4", OverwriteTarget -> True];
Information[v, "ResourcePath"]

Out[2]= File["file.mp4"]
```

#### ShowSubtitles (1)

By default, subtitle tracks are displayed:

```wl
In[1]:= v = AnimationVideo[LinearGradientImage[Hue[t], {200, 100}], {t, 0, 1}];

In[2]:= VideoCombine[{v, {"Hello", "this is my subtitle"}}]

Out[2]= \!\(\*VideoBox["![Embedded Video Player](video://content-96a8t)"]\)
```

Turn off the subtitle track display:

```wl
In[3]:= VideoCombine[{v, {"Hello", "this is my subtitle"}}, ShowSubtitles -> False]

Out[3]= \!\(\*VideoBox["![Embedded Video Player](video://content-at3jb)"]\)
```

#### SubtitleStyle (1)

Combine subtitles with a video using default style:

```wl
In[1]:= a = ExampleData[{"Audio", "Apollo11ReturnSafely"}];

In[2]:= v = VideoGenerator[Entity["MannedSpaceMission", "Apollo11"]["Image"], Duration[a]];

In[3]:= VideoCombine[{v, a, "You will return safely to earth."}]

Out[3]= \!\(\*VideoBox[...]\)

In[4]:= VideoExtractTracks[%, "SubtitleRules"]

Out[4]= {{Quantity[Interval[{0, 2.567000000000001}], "Seconds"] -> Text["You will return safely to earth.", {Center, 10}, {0, -1}, {1, 0}]}}
```

Specify the text style for the subtitle track:

```wl
In[5]:= out = VideoCombine[{v, a, "You will return safely to earth."}, SubtitleStyle -> {Italic, Orange, Bold, Larger, FontFamily -> "Big Caslon", Background -> LightGreen}];

In[6]:= VideoExtractTracks[out, "SubtitleRules"]

Out[6]= {{Quantity[Interval[{0, 2.567000000000001}], "Seconds"] -> Text[***"You will return safely to earth."***, {Center, Bottom}, {0, -1}, {1, 0}]}}
```

### Applications (1)

Generate a video from a ``Manipulate`` and add audio to it:

```wl
In[1]:= m = Video[Manipulate[Plot[Sin[x(1 + a x)], {x, 0, 6}], {a, 0, 2}]]

Out[1]= [image]
```

Combine the generated video with an audio track:

```wl
In[2]:= VideoCombine[{m, ExampleData[{"Audio", "PianoScale"}]}]

Out[2]= [image]

In[3]:= Information[%]

Out[3]= [image]
```

### Properties & Relations (2)

By default, all tracks are included with their original durations:

```wl
In[1]:= v = AnimationVideo[LinearGradientImage[Hue[t]], {t, 0, 1}];

In[2]:= a = ExampleData[{"Audio", "Bee"}];

In[3]:= Duration /@ {v, a}

Out[3]= {Quantity[5.034, "Seconds"], Quantity[2.437233560090703, "Seconds"]}

In[4]:= Import[Information[VideoCombine[{v, a}], "ResourcePath"], "ExactDurations"]

Out[4]= <|"Video" -> Quantity[5.033333333333333, "Seconds"], "Audio" -> Quantity[2.4370068027210885, "Seconds"]|>
```

Pad the audio track to the duration of the video track:

```wl
In[5]:= VideoCombine[{v, AudioPad[a, Duration[v] - Duration[a], "Periodic"]}];
```

Check track durations of the final video:

```wl
In[6]:= Import[Information[%, "ResourcePath"], "ExactDurations"]

Out[6]= <|"Video" -> Quantity[5.033333333333333, "Seconds"], "Audio" -> Quantity[5.033990929705215, "Seconds"]|>
```

---

The track order in the result is determined by the order of the input:

```wl
In[1]:= v1 = VideoGenerator[RandomImage[]];v2 = VideoGenerator[RandomImage[1, 500]];

In[2]:= Information[VideoCombine[{v1, v2}], "VideoTracks"]

Out[2]=
Dataset[Association[1 -> Association["OriginalRasterSize" -> {150, 150}, "VideoEncoding" -> "H264", 
    "BitDepth" -> 8, "ColorSpace" -> "RGB", "FrameRate" -> Quantity[30, "Frames"/"Seconds"]], 
  2 -> Association["OriginalRasterSize" -> {500, 500}, "VideoEncoding" -> "H264", "BitDepth" -> 8, 
    "ColorSpace" -> "RGB", "FrameRate" -> Quantity[30, "Frames"/"Seconds"]]]]

In[3]:= Information[VideoCombine[{v2, v1}], "VideoTracks"]

Out[3]=
Dataset[Association[1 -> Association["OriginalRasterSize" -> {500, 500}, "VideoEncoding" -> "H264", 
    "BitDepth" -> 8, "ColorSpace" -> "RGB", "FrameRate" -> Quantity[30, "Frames"/"Seconds"]], 
  2 -> Association["OriginalRasterSize" -> {150, 150}, "VideoEncoding" -> "H264", "BitDepth" -> 8, 
    "ColorSpace" -> "RGB", "FrameRate" -> Quantity[30, "Frames"/"Seconds"]]]]
```

## See Also

* [`Video`](https://reference.wolfram.com/language/ref/Video.en.md)
* [`VideoTrim`](https://reference.wolfram.com/language/ref/VideoTrim.en.md)
* [`VideoJoin`](https://reference.wolfram.com/language/ref/VideoJoin.en.md)
* [`VideoSplit`](https://reference.wolfram.com/language/ref/VideoSplit.en.md)
* [`VideoDelete`](https://reference.wolfram.com/language/ref/VideoDelete.en.md)
* [`VideoTranscode`](https://reference.wolfram.com/language/ref/VideoTranscode.en.md)
* [`VideoGenerator`](https://reference.wolfram.com/language/ref/VideoGenerator.en.md)
* [`AudioGenerator`](https://reference.wolfram.com/language/ref/AudioGenerator.en.md)
* [`MP4`](https://reference.wolfram.com/language/ref/format/MP4.en.md)
* [`QuickTime`](https://reference.wolfram.com/language/ref/format/QuickTime.en.md)
* [`Matroska`](https://reference.wolfram.com/language/ref/format/Matroska.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) ▪ [2025 (14.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn142.en.md)