RenderJob

data-variant=info
data-slots=text
UXP for Adobe Media Encoder is in public beta. This reference is being written, and the supported API surface may change before general availability.

Since: 27.0

A RenderJob represents a single job in the render queue. It is obtained via RenderQueue.getJob, rather than constructed directly.

const app = require("mediaencoder");
const result = await app.RenderQueue.enqueueFile(
  "path/to/source.mov",
  "path/to/preset.epr",
  "path/to/out.mp4",
);
const job = app.RenderQueue.getJob(result.jobId);

Constants

These Constants are used to interpret getStatus and as parameters to setWorkAreaType. All Constants are class properties, accessed via the RenderJob object:

const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.getStatus() === app.RenderQueue.getJob(jobId).STATUS_ENCODING;

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

STATUS_WAITING

Job is waiting to be processed.

Type: int

Since: 27.0

STATUS_ENCODING

Job is currently encoding.

Type: int

Since: 27.0

STATUS_DONE

Job finished successfully.

Type: int

Since: 27.0

STATUS_DONE_WARNING

Job finished with warnings.

Type: int

Since: 27.0

STATUS_FAILED

Job failed.

Type: int

Since: 27.0

STATUS_PAUSED

Job is paused.

Type: int

Since: 27.0

STATUS_STOPPED

Job was stopped.

Type: int

Since: 27.0

STATUS_SKIPPED

Job was skipped.

Type: int

Since: 27.0

STATUS_INVALID

The job handle is no longer valid, for example if the job was removed from the queue. Returned by getStatus instead of throwing.

Type: int

Since: 27.0

Properties

These read-only properties are available on any RenderJob instance.

const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.batchItemID; // "1b814929-65b6-4d83-b822-68ce5cd2f741"

batchItemID

GUID of the job.

Type: string (readonly)

Since: 27.0

groupID

GUID of the containing job group.

Type: string (readonly)

Since: 27.0

encodingTime

Elapsed encoding time, in seconds.

Type: number (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

Name
Type
Description
startPositionTickTime
object
TickTime object for the start position
endPositionTickTime
object
TickTime object for the end position

Returns

Name
Type
Description
job
object
The updated RenderJob object
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
const startTime = app.TickTime.createWithSeconds(0);
const endTime = app.TickTime.createWithSeconds(1);
job.setCustomInAndOutPoints(startTime, endTime);

setRotation

Sets the rotation of the job (in a 360-degree system).

Since: 27.0

Parameters

Name
Type
Description
rotationValue
int
The rotation value between 0-360 degrees

Returns

Name
Type
Description
job
object
The updated RenderJob object
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.setRotation(45); // Rotate 45 degrees

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

Name
Type
Description
workAreaType
int
One of the WORKAREATYPE_* constant values

Returns

Name
Type
Description
job
object
The updated RenderJob object
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.setWorkAreaType(job.WORKAREATYPE_ENTIRE_SEQUENCE);

getStatus

Gets the current status of the job.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
status
int
One of the STATUS_* constants
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.getStatus();

isInFinalState

Checks whether the job has reached a terminal state (done, failed, or stopped).

Since: 27.0

Parameters

none

Returns

Name
Type
Description
result
boolean
true if the job has reached a terminal state
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.isInFinalState();

getEncodeProgress

Gets the encoding progress as a percentage.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
progress
number
Encoding progress, from 0 to 100
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.getEncodeProgress();

getEncodeProgressMessage

Gets a human-readable progress message for the job.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
message
string
A progress message, such as "Analyzing audio..."
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.getEncodeProgressMessage();

getErrorText

Gets a single-line error string for the job, if it failed.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
error
string
A single-line error string. For the full log, use getLogOutput
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.getErrorText();

getLogOutput

Get the log output of the job.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
logOutput
string
Returns the log output including possible warnings and errors as a JSON string.
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.getLogOutput();

getOutputFilePath

Gets the output file path for the job.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
outputPath
string
File path to the output file
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.getOutputFilePath();

getOutputFilesAfterExport

Gets the list of files written by the encoder after export completes.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
files
string[]
Array of file paths written after export completes
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.getOutputFilesAfterExport();

getPresetName

Gets the name of the preset applied to this job.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
presetName
string
Name of the applied preset
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.getPresetName();

getVideoSummary

Gets a video format summary string for the job.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
summary
string
Video format summary, such as "H.264 1920x1080"
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.getVideoSummary();

getAudioSummary

Gets an audio format summary string for the job.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
summary
string
Audio format summary, such as "AAC, 320 kbps"
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.getAudioSummary();

getBitrateSummary

Gets a bitrate summary string for the job.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
summary
string
Bitrate summary string
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.getBitrateSummary();

moveToTop

Moves this job's containing group to the top of the render queue so it encodes next, raising its priority.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
result
boolean
true on success (or if the job is already at the top); false if the job handle is no longer valid, or the job has no group
const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
job.moveToTop();

getGroup

Returns the RenderJobGroup that contains this job (its shared source). Use it to add more outputs to the same source via RenderJobGroup.addOutput.

Since: 27.0

Parameters

none

Returns

RenderJobGroup, or null if the job handle is no longer valid or it has no group.

const app = require("mediaencoder");
const job = app.RenderQueue.getJob(jobId);
const group = job.getGroup();