Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | List of all members
G3D::VideoInput Class Reference

Read video files from MPG, MP4, AVI, MOV, OGG, ASF, and WMV files. More...

Inherits G3D::ReferenceCountedObject.

Public Member Functions

 ~VideoInput ()
 
bool finished () const
 
float fps () const
 
int height () const
 
RealTime length () const
 
shared_ptr< CPUPixelTransferBuffernextFrame ()
 
bool nextFrame (shared_ptr< Texture > frame)
 Copies the next available frame into the Texture *. More...
 
bool nextFrame (shared_ptr< PixelTransferBuffer > frame)
 Copies the next available frame into the Texture *. More...
 
int width () const
 

Static Public Member Functions

static shared_ptr< VideoInputfromFile (const String &filename)
 
static const ImageFormatimageFormat ()
 

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...
 

Detailed Description

Read video files from MPG, MP4, AVI, MOV, OGG, ASF, and WMV files.

Simply returns the next available frames until the video is finished. Requires a properly formatted SRGB8 or RGB8 Texture or PixelTransferBuffer otherwise will not copy the frame. Use imageFormat() to create the supported format.

Use VideoPlayer to playback a video at the correct speed.

See also
VideoPlayer

Constructor & Destructor Documentation

◆ ~VideoInput()

G3D::VideoInput::~VideoInput ( )

Member Function Documentation

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

◆ finished()

bool G3D::VideoInput::finished ( ) const

◆ fps()

float G3D::VideoInput::fps ( ) const

◆ fromFile()

static shared_ptr<VideoInput> G3D::VideoInput::fromFile ( const String filename)
static
Returns
nullptr if unable to open file or video is not supported

◆ height()

int G3D::VideoInput::height ( ) const

◆ imageFormat()

static const ImageFormat* G3D::VideoInput::imageFormat ( )
static
Returns
Recommended ImageFormat for Texture or PixelTransferBuffer

◆ length()

RealTime G3D::VideoInput::length ( ) const

◆ nextFrame() [1/3]

shared_ptr<CPUPixelTransferBuffer> G3D::VideoInput::nextFrame ( )
Returns
The buffer containing the next available frame or nullptr if no available frame

◆ nextFrame() [2/3]

bool G3D::VideoInput::nextFrame ( shared_ptr< Texture frame)

Copies the next available frame into the Texture *.

Returns
true if frame was available and copied, false otherwise

◆ nextFrame() [3/3]

bool G3D::VideoInput::nextFrame ( shared_ptr< PixelTransferBuffer frame)

Copies the next available frame into the Texture *.

Returns
true if frame was available and copied, false otherwise

◆ width()

int G3D::VideoInput::width ( ) const

documentation generated on Wed Nov 24 2021 08:02:02 using doxygen 1.8.15