Gazebo Common

API Reference

5.6.0

Handle video encoding and decoding using libavcodec. More...

#include <Video.hh>

Public Types

using Length = std::chrono::duration< int64_t, std::ratio< 1, 1000000 > >
 Convenience type alias for duration where 1000000 is the same as AV_TIME_BASE fractional seconds. More...
 

Public Member Functions

 Video ()
 Constructor. More...
 
virtual ~Video ()
 Destructor. More...
 
Length Duration () const
 Get the duration of the video. More...
 
int Height () const
 Get the height of the video in pixels. More...
 
bool Load (const std::string &_filename)
 Load a video file. More...
 
bool NextFrame (unsigned char **_buffer)
 Get the next frame of the video. More...
 
int Width () const
 Get the width of the video in pixels. More...
 

Detailed Description

Handle video encoding and decoding using libavcodec.

Member Typedef Documentation

◆ Length

using Length = std::chrono::duration<int64_t, std::ratio<1, 1000000> >

Convenience type alias for duration where 1000000 is the same as AV_TIME_BASE fractional seconds.

Constructor & Destructor Documentation

◆ Video()

Video ( )

Constructor.

◆ ~Video()

virtual ~Video ( )
virtual

Destructor.

Member Function Documentation

◆ Duration()

Length Duration ( ) const

Get the duration of the video.

Returns
the duration

◆ Height()

int Height ( ) const

Get the height of the video in pixels.

Returns
the height

◆ Load()

bool Load ( const std::string _filename)

Load a video file.

Parameters
[in]_filenameFull path of the video file
Returns
false if a video stream can't be found

◆ NextFrame()

bool NextFrame ( unsigned char **  _buffer)

Get the next frame of the video.

Parameters
[out]_bufferAllocated buffer in which the frame is stored (size has to be width * height * 3 bytes).
Returns
false on error or end of file

◆ Width()

int Width ( ) const

Get the width of the video in pixels.

Returns
the width

The documentation for this class was generated from the following file: