# MediaEncoder

> Create a new encoder with various track arrangements.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEditor.Media](/engine/6000.3/script-reference/unityeditor/media.md)
* **Assembly:** UnityEditor

## MediaEncoder(string, VideoTrackAttributes, AudioTrackAttributes\[])

Create a new encoder with various track arrangements.

```csharp
public MediaEncoder(string filePath, VideoTrackAttributes videoAttrs, AudioTrackAttributes[] audioAttrs)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path fo the media file to be written.**** (\[VideoTrackAttributes]\(/engine/6000.3/script-reference/unityeditor/media/videotrackattributes)): Attributes for the file's video track, if any.**** (\[AudioTrackAttributes\[]]\(/engine/6000.3/script-reference/unityeditor/media/audiotrackattributes)): Attributes for the file's audio tracks, if any.

### Remarks

Throws exceptions when an error is encountered either with the format description or the creation of the file.

## MediaEncoder(string, VideoTrackEncoderAttributes, AudioTrackAttributes\[])

Create a new encoder with various track arrangements.

```csharp
public MediaEncoder(string filePath, VideoTrackEncoderAttributes videoAttrs, AudioTrackAttributes[] audioAttrs)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path fo the media file to be written.**** (\[VideoTrackEncoderAttributes]\(/engine/6000.3/script-reference/unityeditor/media/videotrackencoderattributes)): Attributes for the file's video track, if any.**** (\[AudioTrackAttributes\[]]\(/engine/6000.3/script-reference/unityeditor/media/audiotrackattributes)): Attributes for the file's audio tracks, if any.

### Remarks

Throws exceptions when an error is encountered either with the format description or the creation of the file.

## MediaEncoder(string, VideoTrackEncoderAttributes, AudioTrackAttributes)

Create a new encoder with various track arrangements.

```csharp
public MediaEncoder(string filePath, VideoTrackEncoderAttributes videoAttrs, AudioTrackAttributes audioAttrs)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path fo the media file to be written.**** (\[VideoTrackEncoderAttributes]\(/engine/6000.3/script-reference/unityeditor/media/videotrackencoderattributes)): Attributes for the file's video track, if any.**** (\[AudioTrackAttributes]\(/engine/6000.3/script-reference/unityeditor/media/audiotrackattributes)): Attributes for the file's audio tracks, if any.

### Remarks

Throws exceptions when an error is encountered either with the format description or the creation of the file.

## MediaEncoder(string, VideoTrackEncoderAttributes)

Create a new encoder with various track arrangements.

```csharp
public MediaEncoder(string filePath, VideoTrackEncoderAttributes videoAttrs)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path fo the media file to be written.**** (\[VideoTrackEncoderAttributes]\(/engine/6000.3/script-reference/unityeditor/media/videotrackencoderattributes)): Attributes for the file's video track, if any.

### Remarks

Throws exceptions when an error is encountered either with the format description or the creation of the file.

## MediaEncoder(string, VideoTrackAttributes, AudioTrackAttributes)

Create a new encoder with various track arrangements.

```csharp
public MediaEncoder(string filePath, VideoTrackAttributes videoAttrs, AudioTrackAttributes audioAttrs)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path fo the media file to be written.**** (\[VideoTrackAttributes]\(/engine/6000.3/script-reference/unityeditor/media/videotrackattributes)): Attributes for the file's video track, if any.**** (\[AudioTrackAttributes]\(/engine/6000.3/script-reference/unityeditor/media/audiotrackattributes)): Attributes for the file's audio tracks, if any.

### Remarks

Throws exceptions when an error is encountered either with the format description or the creation of the file.

## MediaEncoder(string, VideoTrackAttributes)

Create a new encoder with various track arrangements.

```csharp
public MediaEncoder(string filePath, VideoTrackAttributes videoAttrs)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path fo the media file to be written.**** (\[VideoTrackAttributes]\(/engine/6000.3/script-reference/unityeditor/media/videotrackattributes)): Attributes for the file's video track, if any.

### Remarks

Throws exceptions when an error is encountered either with the format description or the creation of the file.

## MediaEncoder(string, AudioTrackAttributes\[])

Create a new encoder with various track arrangements.

```csharp
public MediaEncoder(string filePath, AudioTrackAttributes[] audioAttrs)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path fo the media file to be written.**** (\[AudioTrackAttributes\[]]\(/engine/6000.3/script-reference/unityeditor/media/audiotrackattributes)): Attributes for the file's audio tracks, if any.

### Remarks

Throws exceptions when an error is encountered either with the format description or the creation of the file.

## MediaEncoder(string, AudioTrackAttributes)

Create a new encoder with various track arrangements.

```csharp
public MediaEncoder(string filePath, AudioTrackAttributes audioAttrs)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path fo the media file to be written.**** (\[AudioTrackAttributes]\(/engine/6000.3/script-reference/unityeditor/media/audiotrackattributes)): Attributes for the file's audio tracks, if any.

### Remarks

Throws exceptions when an error is encountered either with the format description or the creation of the file.
