A configuration defining a codec. More...
#include <cvb/codec_bridge/codec_config.hpp>
Public Member Functions | |
Cvb::String | Name () const |
Get the name of the codec. More... | |
Cvb::String | ToJson () const |
Create a JSON string that defines this configuration. More... | |
int64_t | BitRate () const |
Get the bit rate. More... | |
void | SetBitRate (int64_t bitRate) |
Set the bit rate. More... | |
Size2D< int > | Size () const |
Get the size of the frames. More... | |
int | ID () const |
Get the codec ID. More... | |
void | SetSize (Size2D< int > size) |
Set the size of the frames. More... | |
Rational | TimeBase () const |
The time base used by the codec. More... | |
void | SetTimeBase (Rational timeBase) |
Set the time base used by the codec. More... | |
int | GOPSize () const |
Get the GOP size. More... | |
void | SetGOPSize (int gopSize) |
Set the GOP size. More... | |
int | MaxBFrames () const |
Get the maximum B frames. More... | |
void | SetMaxBFrames (int maxBFrames) |
Set the maximum B frames. More... | |
CodecBridge::PixelFormat | PixelFormat () const |
Get the pixel format used by this codec. More... | |
void | SetPixelFormat (CodecBridge::PixelFormat pixelFormat) |
Set the pixel format used by this codec. More... | |
template<class T > | |
T | Option (const Cvb::String &name) const |
Get a generic option from the codec. More... | |
template<class T > | |
void | AddOption (const Cvb::String &name, const T &value) |
Add a generic option from the codec. More... | |
Cvb::String | SessionDescription (const Cvb::String &url) |
Get the contend of the session description protocol. More... | |
Static Public Member Functions | |
static std::unique_ptr< CodecConfig > | Create (const Cvb::String &provider) |
Creates a codec config from given provider. More... | |
A configuration defining a codec.
CodecConfig to set up an encoder and/or to create a session description file for decoding.
void AddOption | ( | const Cvb::String & | name, |
const T & | value | ||
) |
Add a generic option from the codec.
[in] | name | The name of the option. |
[in] | value | The value of the option. |
Any | exception derived from std::exception including CvbException. |
See FFmpeg for details on the options. E.g use: ffmpeg.exe -h encoder=libx265
|
inline |
Get the bit rate.
Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Creates a codec config from given provider.
[in] | provider | The name of the codec (e.g libx265) or a JSON file with a complete set of options and properties. |
Any | exception derived from std::exception including CvbException. |
A JSON file can be used to restore a previously saved configuration.
|
inline |
Get the GOP size.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get the codec ID.
Any | exception derived from std::exception including CvbException. |
This ID does refer to the codec method not the codec itself, so all h265 encoders will have the same ID. See FFmpeg to match the IDs.
|
inline |
Get the maximum B frames.
Any | exception derived from std::exception including CvbException. |
|
inline |
Get the name of the codec.
Any | exception derived from std::exception including CvbException. |
T Option | ( | const Cvb::String & | name | ) | const |
Get a generic option from the codec.
Any | exception derived from std::exception including CvbException. |
See FFmpeg for details on the options. E.g use: ffmpeg.exe -h encoder=libx265
|
inline |
Get the pixel format used by this codec.
Any | exception derived from std::exception including CvbException. |
The pixel formats match those used by FFmpeg.
|
inline |
Get the contend of the session description protocol.
Any | exception derived from std::exception including CvbException. |
The session description protocol can be used to decode the raw packet stream, as it contains all the information that would go into an mp4 file for example.
|
inline |
Set the bit rate.
[in] | bitRate | The bit rate. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Set the GOP size.
[in] | gopSize | The group of pictures size. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Set the maximum B frames.
[in] | maxBFrames | The maximum number of bidirectional frames. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Set the pixel format used by this codec.
[in] | pixelFormat | The pixel format. |
Any | exception derived from std::exception including CvbException. |
The pixel formats match those used by FFmpeg.
|
inline |
Set the size of the frames.
[in] | size | The frame size. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Set the time base used by the codec.
[in] | timeBase | The time base (Numerator should be 1). |
Any | exception derived from std::exception including CvbException. |
|
inline |
Get the size of the frames.
Any | exception derived from std::exception including CvbException. |
|
inline |
The time base used by the codec.
Any | exception derived from std::exception including CvbException. |
|
inline |
Create a JSON string that defines this configuration.
Any | exception derived from std::exception including CvbException. |