Miam-Player  0.8.0
A nice music player
QtAV::VideoEncoder Class Referenceabstract

#include <VideoEncoder.h>

Inheritance diagram for QtAV::VideoEncoder:
QtAV::AVEncoder

Signals

void widthChanged ()
 
void heightChanged ()
 
void frameRateChanged ()
 
void pixelFormatChanged ()
 
- Signals inherited from QtAV::AVEncoder
void error (const QtAV::AVError &e)
 
void codecNameChanged ()
 
void bitRateChanged ()
 
void timestampModeChanged (TimestampMode mode)
 

Public Member Functions

virtual VideoEncoderId id () const =0
 
QString name () const Q_DECL_OVERRIDE
 
virtual bool encode (const VideoFrame &frame=VideoFrame())=0
 encode encode a video frame to a Packet More...
 
void setWidth (int value)
 output parameters More...
 
int width () const
 
void setHeight (int value)
 
int height () const
 
void setFrameRate (qreal value)
 TODO: check avctx->supported_framerates. use frame_rate_used. More...
 
qreal frameRate () const
 
void setPixelFormat (const VideoFormat::PixelFormat format)
 setPixelFormat If not set or set to an invalid format, a supported format will be used and pixelFormat() will be that format after open() More...
 
VideoFormat::PixelFormat pixelFormat () const
 
- Public Member Functions inherited from QtAV::AVEncoder
virtual ~AVEncoder ()
 
virtual QString description () const
 
void setCodecName (const QString &name)
 setCodecName An encoder can support more than 1 codec. More...
 
QString codecName () const
 
bool open ()
 
bool close ()
 
bool isOpen () const
 
virtual void flush ()
 
Packet encoded () const
 
virtual void copyAVCodecContext (void *ctx)
 used by ff muxer. More...
 
void * codecContext () const
 
void setBitRate (int value)
 setBitRate Higher bit rate result in better quality. More...
 
int bitRate () const
 
TimestampMode timestampMode () const
 
void setTimestampMode (TimestampMode value)
 
void setOptions (const QVariantHash &dict)
 setOptions More...
 
QVariantHash options () const
 

Static Public Member Functions

static QStringList supportedCodecs ()
 
static VideoEncodercreate (VideoEncoderId id)
 
static VideoEncodercreate (const char *name="FFmpeg")
 create create an encoder from registered names More...
 
static qreal defaultFrameRate ()
 
template<class C >
static bool Register (VideoEncoderId id, const char *name)
 
static VideoEncoderIdnext (VideoEncoderId *id=0)
 next More...
 
static const char * name (VideoEncoderId id)
 
static VideoEncoderId id (const char *name)
 

Protected Member Functions

 VideoEncoder (VideoEncoderPrivate &d)
 
- Protected Member Functions inherited from QtAV::AVEncoder
 AVEncoder (AVEncoderPrivate &d)
 

Properties

int width
 
int height
 
qreal frameRate
 
QtAV::VideoFormat::PixelFormat pixelFormat
 
- Properties inherited from QtAV::AVEncoder
int bitRate
 
QString codecName
 
TimestampMode timestampMode
 

Additional Inherited Members

- Public Types inherited from QtAV::AVEncoder
enum  TimestampMode { TimestampMonotonic, TimestampCopy }
 

Constructor & Destructor Documentation

◆ VideoEncoder()

QtAV::VideoEncoder::VideoEncoder ( VideoEncoderPrivate d)
protected

Member Function Documentation

◆ create() [1/2]

static VideoEncoder* QtAV::VideoEncoder::create ( VideoEncoderId  id)
static

◆ create() [2/2]

static VideoEncoder* QtAV::VideoEncoder::create ( const char *  name = "FFmpeg")
static

create create an encoder from registered names

Parameters
namecan be "FFmpeg". FFmpeg encoder will be created for empty name
Returns
0 if not registered

◆ defaultFrameRate()

static qreal QtAV::VideoEncoder::defaultFrameRate ( )
inlinestatic

◆ encode()

virtual bool QtAV::VideoEncoder::encode ( const VideoFrame frame = VideoFrame())
pure virtual

encode encode a video frame to a Packet

Parameters
framepass an invalid frame to get delayed frames
Returns

◆ frameRate()

qreal QtAV::VideoEncoder::frameRate ( ) const

◆ frameRateChanged

void QtAV::VideoEncoder::frameRateChanged ( )
signal

◆ height()

int QtAV::VideoEncoder::height ( ) const

◆ heightChanged

void QtAV::VideoEncoder::heightChanged ( )
signal

◆ id() [1/2]

virtual VideoEncoderId QtAV::VideoEncoder::id ( ) const
pure virtual

◆ id() [2/2]

static VideoEncoderId QtAV::VideoEncoder::id ( const char *  name)
static

◆ name() [1/2]

QString QtAV::VideoEncoder::name ( ) const
virtual

Implements QtAV::AVEncoder.

◆ name() [2/2]

static const char* QtAV::VideoEncoder::name ( VideoEncoderId  id)
static

◆ next()

static VideoEncoderId* QtAV::VideoEncoder::next ( VideoEncoderId id = 0)
static

next

Parameters
idNULL to get the first id address
Returns
address of id or NULL if not found/end

◆ pixelFormat()

VideoFormat::PixelFormat QtAV::VideoEncoder::pixelFormat ( ) const

◆ pixelFormatChanged

void QtAV::VideoEncoder::pixelFormatChanged ( )
signal

◆ Register()

template<class C >
static bool QtAV::VideoEncoder::Register ( VideoEncoderId  id,
const char *  name 
)
inlinestatic

◆ setFrameRate()

void QtAV::VideoEncoder::setFrameRate ( qreal  value)

TODO: check avctx->supported_framerates. use frame_rate_used.

setFrameRate If frame rate is not set, frameRate() returns -1, but internally the default frame rate 25 will be used

Parameters
value

◆ setHeight()

void QtAV::VideoEncoder::setHeight ( int  value)

◆ setPixelFormat()

void QtAV::VideoEncoder::setPixelFormat ( const VideoFormat::PixelFormat  format)

setPixelFormat If not set or set to an invalid format, a supported format will be used and pixelFormat() will be that format after open()

Parameters
format

◆ setWidth()

void QtAV::VideoEncoder::setWidth ( int  value)

output parameters

setWidth set the encoded video width. The same as input frame size if value <= 0

◆ supportedCodecs()

static QStringList QtAV::VideoEncoder::supportedCodecs ( )
static

◆ width()

int QtAV::VideoEncoder::width ( ) const

◆ widthChanged

void QtAV::VideoEncoder::widthChanged ( )
signal

Property Documentation

◆ frameRate

qreal QtAV::VideoEncoder::frameRate
readwrite

◆ height

int QtAV::VideoEncoder::height
readwrite

◆ pixelFormat

QtAV::VideoFormat::PixelFormat QtAV::VideoEncoder::pixelFormat
readwrite

◆ width

int QtAV::VideoEncoder::width
readwrite

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