Support Forum G3D Web Page |
Creates video files such as mp4/h264 from provided frames or textures. More...
Inherits G3D::ReferenceCountedObject.
Classes | |
class | Encoder |
class | Settings |
Public Member Functions | |
~VideoOutput () | |
void | abort () |
Aborts writing video file and ends encoding. More... | |
void | append (const shared_ptr< Texture > &frame, bool invertY=false) |
void | append (const shared_ptr< PixelTransferBuffer > &frame) |
void | append (class RenderDevice *rd, bool useBackBuffer=false) |
Append the current frame on the RenderDevice to this video. More... | |
void | commit () |
Finishes writing video file and ends encoding. More... | |
const String & | filename () const |
bool | finished () |
const Settings & | settings () const |
Static Public Member Functions | |
static shared_ptr< VideoOutput > | create (const String &filename, const Settings &settings) |
Video files have a file format and a codec. More... | |
Protected Member Functions | |
VideoOutput (const String &filename, const Settings &settings) | |
void | encodeFrame (const uint8 *pixels, const ImageFormat *format) |
bool | initialize () |
void | shutdown () |
bool | validSettings () |
Static Protected Member Functions | |
template<class T , class ... ArgTypes> | |
static shared_ptr< T > | createShared (ArgTypes &&... args) |
Like std::make_shared, but works for protected constructors. More... | |
Protected Attributes | |
AVFilterContext * | m_avBufferSink |
AVFilterContext * | m_avBufferSrc |
AVFilterGraph * | m_avFilterGraph |
AVFormatContext * | m_avFormatContext |
AVDictionary * | m_avOptions |
AVCodecContext * | m_avVideoContext |
AVStream * | m_avVideoStream |
String | m_filename |
int | m_framecount |
bool | m_isFinished |
bool | m_isInitialized |
Settings | m_settings |
Creates video files such as mp4/h264 from provided frames or textures.
G3D::VideoOutput::~VideoOutput | ( | ) |
void G3D::VideoOutput::abort | ( | ) |
Aborts writing video file and ends encoding.
void G3D::VideoOutput::append | ( | const shared_ptr< Texture > & | frame, |
bool | invertY = false |
||
) |
void G3D::VideoOutput::append | ( | const shared_ptr< PixelTransferBuffer > & | frame | ) |
void G3D::VideoOutput::append | ( | class RenderDevice * | rd, |
bool | useBackBuffer = false |
||
) |
Append the current frame on the RenderDevice to this video.
useBackBuffer | If true, read from the back buffer (the current frame) instead of the front buffer. to be replaced/removed. |
void G3D::VideoOutput::commit | ( | ) |
Finishes writing video file and ends encoding.
|
static |
Video files have a file format and a codec.
VideoOutput chooses the file format based on the filename's extension (e.g., .avi creates an AVI file) and the codec based on Settings::codec
|
inlinestaticprotectedinherited |
Like std::make_shared, but works for protected constructors.
Call as createShared<myclass>.
|
protected |
|
inline |
|
inline |
|
protected |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by filename().
|
protected |
|
protected |
Referenced by finished().
|
protected |
|
protected |
Referenced by settings().