AVRecorder.SetEncoder
---------------------

Sets the encoder to use for video.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [AVRecorder](component_AVRecorder.md) | [9.1](newinversion91.md) | ❌ No | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "AVRecorder.SetEncoder"; AVSession; Encoder ) 

**MBS**( **"AVRecorder.SetEncoder";** /\* Sets the encoder to use for video. \*/  
**$AVSession**; /\* The ID for the AVRecorder session as returned by [AVRecorder.Init](AVRecorderInit.md). \*/   
**$Encoder**) /\* The encoder name, ID or index.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| AVSession | The ID for the AVRecorder session as returned by [AVRecorder.Init](AVRecorderInit.md). | $AVSession |
| Encoder | The encoder name, ID or index. | 0 |

### Result

Returns OK or error.

### Description

Sets the encoder to use for video.  
Not all combinations of video source, encoder and destination file will work.  
[AVRecorder.StartRecording](AVRecorderStartRecording.md) may fail later.  
  
On Mac and iOS we use standard encoder by default (H264 usually).  
### Examples

Set encoder:

 MBS ( "AVRecorder.SetEncoder"; $AVSession ; "WMVideo9 Encoder DMO" )  
Set DV encoder:

 MBS ("AVRecorder.SetEncoder"; AVRecorder::Session ; "DV Video Encoder")  
### See also

- [AVRecorder.GetEncoder](AVRecorderGetEncoder.md)
- [AVRecorder.Init](AVRecorderInit.md)
- [AVRecorder.StartRecording](AVRecorderStartRecording.md)

### Release notes

- **Version 9.1**
    - Added [AVRecorder.EncoderCount](http://www.mbsplugins.eu/AVRecorderEncoderCount.shtml), [AVRecorder.EncoderInfo](http://www.mbsplugins.eu/AVRecorderEncoderInfo.shtml), [AVRecorder.GetEncoder](http://www.mbsplugins.eu/AVRecorderGetEncoder.shtml) and [AVRecorder.SetEncoder](http://www.mbsplugins.eu/AVRecorderSetEncoder.shtml) functions to define encoder for AVRecorder on Windows.

### Blog Entries

- [MBS FileMaker Plugin, version 9.1pr4](https://www.mbsplugins.de/archive/2019-02-25/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 24th February 2019 , last changed 24th February 2019

  
[AVRecorder.SetAutomaticallyAdjustsVideoMirroring](AVRecorderSetAutomaticallyAdjustsVideoMirroring.md) - [AVRecorder.SetFilePath](AVRecorderSetFilePath.md)

[HTML Version](AVRecorderSetEncoder.shtml)