Navigation
API > API/Plugins > API/Plugins/TmvMedia
The transcode job implements a staged transcoding pipeline.
The stages are pre-determined and described as follows (in that order):
- FrameProducer: media source, produces the frames that are pushed to the frame converter.
- FrameConverter: Bridges the producer and encoder. It will inspect the needed format for encoder and produce the appropriate conversion.
- FrameEncoder: Receives frames ready (in the right format) to be encoded by a tmv encoder. It will query the muxer stage to get an access unit.
- FrameMuxer: Final stage of the pipeline that will typically write to file or media container.
There can only be one stage of each class per pipeline and the order is fixed as listed above.
Todo - Audio and other streams: The current implementation only deals with a single video stream. For audio streams, we will need to make the pipeline more complex and deal with different streams into a common muxer stage.
| Name | UTmvMediaTranscodeJob |
| Type | class |
| Header File | /Engine/Plugins/Media/TmvMedia/Source/TmvMedia/Public/Transcoder/TmvMediaTranscodeJob.h |
| Include Path | #include "Transcoder/TmvMediaTranscodeJob.h" |
Syntax
UCLASS (MinimalAPI)
class UTmvMediaTranscodeJob : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UTmvMediaTranscodeJob
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UTmvMediaTranscodeJob() |
Transcoder/TmvMediaTranscodeJob.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsError | std::atomic< bool > | Indicate a stage had an error somewhere that requires the job to stop. | Transcoder/TmvMediaTranscodeJob.h | |
| JobName | FString | Original Job Item Name. | Transcoder/TmvMediaTranscodeJob.h | |
| JobStatus | std::atomic< ETmvMediaTranscodeJobStatus > | Overall job state. | Transcoder/TmvMediaTranscodeJob.h | |
| Settings | FTmvMediaTranscodeJobSettings | Common job settings. | Transcoder/TmvMediaTranscodeJob.h | |
| Stages | TArray< TObjectPtr< UTmvMediaTranscodeStage > > | Stages in this pipeline. | Transcoder/TmvMediaTranscodeJob.h | |
| StopReason | ETmvMediaTranscodeJobStopReason | Keep track of the stopping reason. This is mostly used for UI and logging. | Transcoder/TmvMediaTranscodeJob.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Id | FGuid | Unique Id of this job item (from a corresponding job list). | Transcoder/TmvMediaTranscodeJob.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool AddStage
(
UTmvMediaTranscodeStage* InStage |
Add the specified stage to the pipeline. | Transcoder/TmvMediaTranscodeJob.h | |
bool AreStagesStopped() |
Returns true if all the stages are stopped. | Transcoder/TmvMediaTranscodeJob.h | |
DECLARE_TS_MULTICAST_DELEGATE_OneParam
(
FOnTranscodeJobFinished |
Job Finished Delegate. | Transcoder/TmvMediaTranscodeJob.h | |
DECLARE_TS_MULTICAST_DELEGATE_ThreeParams
(
FOnTranscodeJobEvent |
Job Event Delegate. | Transcoder/TmvMediaTranscodeJob.h | |
void Discard
(
double InCurrentTime |
When the job is done and will not be used anymore, explicitly discarding it to remove it from the job manager. | Transcoder/TmvMediaTranscodeJob.h | |
const FGuid & GetId() |
Returns Job Id. | Transcoder/TmvMediaTranscodeJob.h | |
FTmvMediaTranscodingJobStats GetJobStats() |
Returns a copy of job stats (thread safe). | Transcoder/TmvMediaTranscodeJob.h | |
TStageClass * GetStage() |
Get the specified stage from the stage class. There is only one stage of each type in the pipeline. | Transcoder/TmvMediaTranscodeJob.h | |
bool IsCompleted() |
Determine the global status of the jobs to see if it is completed or not. | Transcoder/TmvMediaTranscodeJob.h | |
bool IsRunning() |
Returns true if overall job status is running. | Transcoder/TmvMediaTranscodeJob.h | |
void RequestStop
(
double InCurrentTime, |
Request Stop (cancel) the job. | Transcoder/TmvMediaTranscodeJob.h | |
void SetId
(
const FGuid& InId |
Update the id of a job. | Transcoder/TmvMediaTranscodeJob.h | |
void SetNotificationHandler
(
const TSharedPtr< ITmvMediaTranscodeNotification >& InNotification |
(Optional) Set a notification handler that will be used for progress update display. | Transcoder/TmvMediaTranscodeJob.h | |
bool Start
(
double InCurrentTime |
Start the job. | Transcoder/TmvMediaTranscodeJob.h | |
void Tick
(
const FTmvMediaTranscodeJobTime& InTime |
Tick called in the main thread. Performs sync tasks. | Transcoder/TmvMediaTranscodeJob.h | |
void UpdateProgress
(
int32 InCurrentFrame, |
Update job progress stats. | Transcoder/TmvMediaTranscodeJob.h |
Public Virtual
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginDestroy() |
Transcoder/TmvMediaTranscodeJob.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void SafeBroadcastJobEvent
(
UTmvMediaTranscodeJob* InJob, |
Helper function to broadcast a job event. | Transcoder/TmvMediaTranscodeJob.h | |
static void SafeBroadcastJobFinished
(
UTmvMediaTranscodeJob* InJob |
Helper function to broadcast job finished event. | Transcoder/TmvMediaTranscodeJob.h | |
static void SafeReportError
(
UTmvMediaTranscodeJob* InJob, |
Called by the processing stages in case a fatal error requires the job to stop. | Transcoder/TmvMediaTranscodeJob.h | |
static void SafeUpdateProgress
(
UTmvMediaTranscodeJob* InJob, |
Helper function to update the job progress stats. | Transcoder/TmvMediaTranscodeJob.h |