Performs H.264 encoding and writing to an MP4 container from PvBuffers. More...
Public Member Functions | |
PvMp4Writer () | |
Constructor. | |
~PvMp4Writer () | |
Destructor. | |
bool | IsAvailable () const |
Returns true if H.264 encoding and MP4 output is supported on the system. More... | |
bool | IsOpened () |
Returns true if the writer is already opened. More... | |
PvResult | Open (const PvString &aFilename, PvImage *aImage) |
Opens the writer. More... | |
PvResult | WriteFrame (PvImage *aImage, uint32_t *aFileSizeDelta) |
Writes a frame to the MP4 file. More... | |
PvResult | Close () |
Closes the writer. More... | |
uint32_t | GetAvgBitrate () const |
Returns the average bitrate the writer is configured with. More... | |
PvResult | SetAvgBitrate (uint32_t aValue) |
Sets the average bitrate of H.264 encoding for the writer. More... | |
void | GetLastError (PvString &aString) const |
Returns the last error that occured with the MP4 writer. More... | |
void | ResetLastError () |
Resets the last error reported by the object. | |
Performs H.264 encoding and writing to an MP4 container from PvBuffers.
Call Open with the first image and filename, call write for every buffer (including the first one) and finilize using the Close method. The MP4 file will not be valid until/unless the Close method (or descructor) is executed.
When saving H.264 video in an MP4 container on the Windows operating system, eBUS Player uses the Microsoft Media Foundation H.264 video encoder. The default video encoder settings are used, with the exception of the frame rate and average bit rate. The video is encoded at 30 frames per second. And the average bit rate is set to the value specified in the eBUS Player Image and Video Saving Options dialog box. For more information, please refer to eBUS Player User Guide.
PvResult PvMp4Writer::Close | ( | ) |
Closes the writer.
uint32_t PvMp4Writer::GetAvgBitrate | ( | ) | const |
Returns the average bitrate the writer is configured with.
void PvMp4Writer::GetLastError | ( | PvString & | aString | ) | const |
Returns the last error that occured with the MP4 writer.
[out] | aString | String where the last error description is copied. |
bool PvMp4Writer::IsAvailable | ( | ) | const |
Returns true if H.264 encoding and MP4 output is supported on the system.
bool PvMp4Writer::IsOpened | ( | ) |
Returns true if the writer is already opened.
Opens the writer.
[in] | aFilename | The filename of the MP4: full path including the mp4 extension. |
[in] | aImage | Image similar in width, height and pixel format to the stream to encode. |
PvResult PvMp4Writer::SetAvgBitrate | ( | uint32_t | aValue | ) |
Sets the average bitrate of H.264 encoding for the writer.
The average bitrate must be set before opening the writer.
[in] | aValue | The new average bitrate value. |
Writes a frame to the MP4 file.
Note: the image used to open the writer is not encoded or written to the file. If you are using the first image to open the file, you need to call WriteFrame with the same image as well.
[in] | aImage | Image to encode to H.264 and write to the MP4 file. |
[out] | aFileSizeDelta | Pointer to an integer where the file size delta for encoding/writing this frame is written (optional, NULL if not needed) |
Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com