Gazebo Common

API Reference

6.0.1

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.
 

Public Member Functions

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

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: