Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
BIAS::VideoSink Class Reference

VideoSink for writing FFMPEG Videos from images. More...

#include <VideoSink/VideoSink.hh>

+ Collaboration diagram for BIAS::VideoSink:

Public Member Functions

void AddImage (std::string Image)
 Append an image to the end of the list. More...
 
void AddImages (std::vector< std::string > Images)
 
bool Encode ()
 Encode the video. More...
 
std::string GetErrMsg ()
 Return the last produced errormessage. More...
 
void SetBitrate (int Bitrate)
 Set the bitrate of the output video. More...
 
void SetBPP (double BPP)
 Set the bits per pixel of the output video. More...
 
void SetFPS (float FPS)
 Set the framerate for the video. More...
 
void SetOutputVideo (std::string Video)
 Set the file where the video will be written to. More...
 
 VideoSink ()
 
 VideoSink (std::string Video)
 
 VideoSink (std::vector< std::string > Images)
 
 VideoSink (std::vector< std::string > Images, std::string Video)
 
 ~VideoSink ()
 

Protected Member Functions

bool _SetupVideoSource ()
 

Static Protected Member Functions

static void _RGB888pToYUV420p (uint8_t *rgb, uint8_t *yuv, int width, int height)
 Convert RGB888p data to Y'UV420p. More...
 

Protected Attributes

int _Bitrate
 
int _BPP
 
AVCodec * _Codec
 
AVCodecContext * _CodecCtx
 
std::string _ErrMsg
 
float _FPS
 
std::vector< std::string > _ImgFiles
 
bool _IsYUV
 
std::string _Video
 
VideoSource_Disk _VSD
 

Detailed Description

VideoSink for writing FFMPEG Videos from images.

Author
Friso Evers
Deprecated:
Is replaced by VideoSink_FFmpeg
Examples:
ExampleVideoSink.cpp.

Definition at line 68 of file VideoSink.hh.

Constructor & Destructor Documentation

BIAS::VideoSink::VideoSink ( )

Definition at line 31 of file VideoSink.cpp.

Referenced by VideoSink().

BIAS::VideoSink::VideoSink ( std::string  Video)

Definition at line 42 of file VideoSink.cpp.

References VideoSink().

BIAS::VideoSink::VideoSink ( std::vector< std::string >  Images)

Definition at line 47 of file VideoSink.cpp.

References VideoSink().

BIAS::VideoSink::VideoSink ( std::vector< std::string >  Images,
std::string  Video 
)

Definition at line 52 of file VideoSink.cpp.

References VideoSink().

BIAS::VideoSink::~VideoSink ( )

Definition at line 57 of file VideoSink.cpp.

Member Function Documentation

void BIAS::VideoSink::_RGB888pToYUV420p ( uint8_t *  rgb,
uint8_t *  yuv,
int  width,
int  height 
)
staticprotected

Convert RGB888p data to Y'UV420p.

Parameters
rgbPointer to RGB data.
yuvPointer to YUV data, must point to an allocated memory with a minimum size of (width*height * 3) / 2.

Definition at line 110 of file VideoSink.cpp.

bool BIAS::VideoSink::_SetupVideoSource ( )
protected

Definition at line 314 of file VideoSink.cpp.

References BIAS::ImageBase::CM_RGB, and BIAS::ImageBase::CM_YUV420P.

void BIAS::VideoSink::AddImage ( std::string  Image)

Append an image to the end of the list.

Examples:
ExampleVideoSink.cpp.

Definition at line 61 of file VideoSink.cpp.

void BIAS::VideoSink::AddImages ( std::vector< std::string >  Images)

Definition at line 65 of file VideoSink.cpp.

bool BIAS::VideoSink::Encode ( )
std::string BIAS::VideoSink::GetErrMsg ( )

Return the last produced errormessage.

Use the return value of the methods to test for errors though since this message is not reset on success.

Examples:
ExampleVideoSink.cpp.

Definition at line 308 of file VideoSink.cpp.

void BIAS::VideoSink::SetBitrate ( int  Bitrate)

Set the bitrate of the output video.

This overrides a value set by SetBPP.

Definition at line 79 of file VideoSink.cpp.

void BIAS::VideoSink::SetBPP ( double  BPP)

Set the bits per pixel of the output video.

The initial value is 4. This overrides a value set by SetBitrate.

Examples:
ExampleVideoSink.cpp.

Definition at line 84 of file VideoSink.cpp.

void BIAS::VideoSink::SetFPS ( float  FPS)

Set the framerate for the video.

Note that the encoder only works with some values (e.g. 25, 50).

Examples:
ExampleVideoSink.cpp.

Definition at line 74 of file VideoSink.cpp.

void BIAS::VideoSink::SetOutputVideo ( std::string  Video)

Set the file where the video will be written to.

This or the according constructor must be called befor encoding.

Examples:
ExampleVideoSink.cpp.

Definition at line 70 of file VideoSink.cpp.

Member Data Documentation

int BIAS::VideoSink::_Bitrate
protected

Definition at line 134 of file VideoSink.hh.

int BIAS::VideoSink::_BPP
protected

Definition at line 135 of file VideoSink.hh.

AVCodec* BIAS::VideoSink::_Codec
protected

Definition at line 139 of file VideoSink.hh.

AVCodecContext* BIAS::VideoSink::_CodecCtx
protected

Definition at line 140 of file VideoSink.hh.

std::string BIAS::VideoSink::_ErrMsg
protected

Definition at line 143 of file VideoSink.hh.

float BIAS::VideoSink::_FPS
protected

Definition at line 133 of file VideoSink.hh.

std::vector<std::string> BIAS::VideoSink::_ImgFiles
protected

Definition at line 131 of file VideoSink.hh.

bool BIAS::VideoSink::_IsYUV
protected

Definition at line 137 of file VideoSink.hh.

std::string BIAS::VideoSink::_Video
protected

Definition at line 132 of file VideoSink.hh.

VideoSource_Disk BIAS::VideoSink::_VSD
protected

Definition at line 136 of file VideoSink.hh.


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