Navigation
API > API/Plugins > API/Plugins/MP4Muxer
This module implements a basic mp4 file multiplexer/writer.
The data to be written is handled as RAW data and is not checked for validity. Data is also expected to be framed already, that is, one data packet corresponds to one media sample.
If the packet data requires internal sample sizes, eg. NAL unit start codes to be replaced with the NAL size for AVC/HEVC video, this needs to have been done already as well.
Codec specific data, like configuration boxes, also need to be set up already in an mp4 box structure and provided per box, which will also just be written as raw data.
| Name | IMP4RawMuxer |
| Type | class |
| Header File | /Engine/Plugins/Media/MP4Utilities/Source/MP4Muxer/Public/MP4Muxer.h |
| Include Path | #include "MP4Muxer.h" |
Syntax
class IMP4RawMuxer
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~IMP4RawMuxer() |
MP4Muxer.h |
Structs
| Name | Remarks |
|---|---|
| FConfiguration | |
| FSampleRequest | Defines an entry in the sample request array the registered `FRequestTrackDataDelegate_ provides indicating for which track(s) another sample is needed before a new chunk (a group of samples) can be written. |
| FTrackSample | This structure defines the sample to be added to a track during the muxing process. |
| FTrackSpec |
Enums
Public
| Name | Remarks |
|---|---|
| EStatus | State value reported to the registered `FStatusDelegate_. |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FRequestTrackDataDelegate | TBaseDelegate_OneParam< void, const TArray< FSampleRequest > & > | MP4Muxer.h | |
| FStatusDelegate | TBaseDelegate_OneParam< void, EStatus > | MP4Muxer.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 AddTrack
(
const FTrackSpec& InTrackSpec |
Adds a track to be written. | MP4Muxer.h | |
bool AddTrackReference
(
int32 InTrackIndexToAddReferenceTo, |
Adds a track reference. | MP4Muxer.h | |
bool AddTrackSample
(
int32 InTrack, |
Adds a sample to be written into the specified track as a response to a sample request made by the `FRequestTrackDataDelegate_. | MP4Muxer.h | |
bool Configure
(
const FConfiguration& InConfiguration |
Configures the muxer. | MP4Muxer.h | |
FString GetLastError() |
Returns a human readable error message if muxing failed. | MP4Muxer.h | |
bool Start
(
FRequestTrackDataDelegate InSampleRequestDelegate, |
This method starts the muxing process. | MP4Muxer.h | |
bool StopAndClose () |
Stops muxing and closes the output file. | MP4Muxer.h |
Public Virtual
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TSharedRef< IMP4RawMuxer, ESPMode::ThreadSafe > Create() |
MP4Muxer.h | ||
static TArray< uint8 > WrapDataInBox
(
uint32 InBoxAtom, |
Wraps binary data in a box. Useful for creating the additional FTrackSpec::SampleEntryBoxes. | MP4Muxer.h | |
static TArray< uint8 > WrapDataInBox
(
uint32 InBoxAtom, |
Wraps binary data in a full box. Useful for creating the additional FTrackSpec::SampleEntryBoxes. | MP4Muxer.h |