Render Options
The Media Encoder Render Options API is the used for all operations involving managing encoding properties in the app.
data-variant=info
data-slots=text
A Render Options instance can be created from the main app object:
const app = require("mediaencoder");
const renderOptions = new app.RenderOptions();
Constants
These Render Options Constants are used as parameters in various RenderQueue and RenderOptions API methods for Media Encoder.
All Constants can be accessed via the RenderOptions object:
const app = require("mediaencoder");
const RenderOptions = app.RenderOptions;
const WORKAREATYPE_CUSTOM = RenderOptions.WORKAREATYPE_CUSTOM; // 3
WORKAREATYPE_CUSTOM
Work area type value for custom in / out points
Type: int
Since: 27.0
WORKAREATYPE_DEFAULT
Work area type value for the default in / out points from the sequence
Type: int
Since: 27.0
WORKAREATYPE_ENTIRE_SEQUENCE
Work area type value for the entire duration of the sequence
Type: int
Since: 27.0
WORKAREATYPE_IN_TO_OUT_POINTS
Work area type value for the set in / out points of the sequence
Type: int
Since: 27.0
WORKAREATYPE_WORKAREA
Work area type value for the entire workarea of the sequence
Type: int
Since: 27.0
Properties
These read-only properties reflect the current state of a RenderOptions instance, based on the setter methods that have been called on it.
const app = require("mediaencoder");
const renderOptions = new app.RenderOptions();
renderOptions.workAreaType; // 4
customInPoint
The custom in point set via setCustomInAndOutPoints(), as a TickTime object.
Type: object (readonly)
Since: 27.0
customOutPoint
The custom out point set via setCustomInAndOutPoints(), as a TickTime object.
Type: object (readonly)
Since: 27.0
rotation
The rotation value (in a 360-degree system) set via setRotation(). Undefined if setRotation() has not been called.
Type: number (optional) (readonly)
Since: 27.0
workAreaType
The work area type set via setWorkAreaType(). One of the WORKAREATYPE_* constants.
Type: int (readonly)
Since: 27.0
Methods
setCustomInAndOutPoints
Sets custom in and out points in the sequence. Note that the WORKAREATYPE_CUSTOM work area type will be set implicitly here.
Since: 27.0
Parameters
Returns
const app = require("mediaencoder");
const renderOptions = new app.RenderOptions();
const startTime = app.TickTime.createWithSeconds(0);
const endTime = app.TickTime.createWithSeconds(1);
renderOptions.setCustomInAndOutPoints(startTime, endTime);
See the TickTime reference for how to construct these values.
setImportSequencesNatively
Sets the "Import Sequences Natively" flag, which allows Media Encoder to import sequences directly from a Premiere Pro project file without needing to open Premiere Pro.
Since: 27.0
Parameters
true to import sequences natively; false to import via Dynamic LinkReturns
const app = require("mediaencoder");
const renderOptions = new app.RenderOptions();
renderOptions.setImportSequencesNatively(true);
setIncludeSourceXMP
Sets whether source XMP metadata is included in the output. Default is false.
Since: 27.0
Parameters
true to include source XMP metadata in the outputReturns
const app = require("mediaencoder");
const renderOptions = new app.RenderOptions();
renderOptions.setIncludeSourceXMP(true);
setOverwriteOutputFile
Controls overwrite behavior for the output file. If set to true, the specified output file path will be overwritten. If set to false, the global overwrite preference is respected.
Since: 27.0
Parameters
true to overwrite the output file; false to respect the global preferenceReturns
const app = require("mediaencoder");
const renderOptions = new app.RenderOptions();
renderOptions.setOverwriteOutputFile(true);
setRotation
Sets the rotation of the render options instance (in a 360-degree system).
Since: 27.0
Parameters
Returns
const app = require("mediaencoder");
const renderOptions = new app.RenderOptions();
renderOptions.setRotation(45); // Rotate 45 degrees
setSequenceGUID
Sets the sequence or composition to render.
Since: 27.0
Parameters
RenderQueue to retrieve the GUIDs.Returns
const app = require("mediaencoder");
const renderOptions = new app.RenderOptions();
const res = app.RenderQueue.getProjectItemGUIDs("path/to/project.prproj");
renderOptions.setSequenceGUID(res.guids[0]);
setWorkAreaType
Sets the designated type of work area. Use the WORKAREATYPE_* constants to specify the desired type of work area.
Works only with project files that contain sequences. If the input sequence has a predefined work area or in and out points, this method will set them properly. Note that the custom work area type will only function correctly if you have previously called setCustomInAndOutPoints.
Since: 27.0
Parameters
WORKAREATYPE_* constant valuesReturns
const app = require("mediaencoder");
const renderOptions = new app.RenderOptions();
renderOptions.setWorkAreaType(app.RenderOptions.WORKAREATYPE_ENTIRE_SEQUENCE);