AvTranscoder  0.9.4
C++APIforLibav/FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
avtranscoder::VideoProperties Class Reference

#include <VideoProperties.hpp>

Public Member Functions

 VideoProperties (const FormatContext &formatContext, const size_t index, IProgress &progress, const EAnalyseLevel level=eAnalyseLevelFirstGop)
 
std::string getProfileName () const
 
std::string getColorTransfert () const
 
std::string getColorspace () const
 
std::string getColorRange () const
 
std::string getColorPrimaries () const
 
std::string getChromaSampleLocation () const
 
std::string getFieldOrder () const
 
PixelPropertiesgetPixelProperties ()
 
int64_t getStartTimecode () const
 
std::string getStartTimecodeString () const
 
Rational getSar () const
 
Rational getDar () const
 
size_t getBitRate () const
 in bits/s More...
 
size_t getMaxBitRate () const
 
size_t getMinBitRate () const
 
size_t getNbFrames () const
 
size_t getTicksPerFrame () const
 
size_t getWidth () const
 
size_t getHeight () const
 
size_t getDtgActiveFormat () const
 
size_t getReferencesFrames () const
 
int getProfile () const
 
int getLevel () const
 
float getFps () const
 Corresponds to the 'fps' returned by ffprobe. fps = the average framerate that has come from the AVStream tbn = the time base in AVStream that has come from the AVStream tbc = the time base in AVCodecContext for the codec used for a particular stream tbr = tbr is guessed from the video stream and is the value users want to see when they look for the video frame rate. More...
 
bool hasBFrames () const
 
AVCodecContext & getAVCodecContext ()
 
const PixelPropertiesgetPixelProperties () const
 
PropertyVectorfillVector (PropertyVector &data) const
 To avoid copy of the vector. More...
 
bool isInterlaced () const
 
bool isTopFieldFirst () const
 
size_t getGopSize () const
 
std::vector< std::pair< char,
int > > 
getGopStructure () const
 
- Public Member Functions inherited from avtranscoder::StreamProperties
 StreamProperties (const FormatContext &formatContext, const size_t index)
 
virtual ~StreamProperties ()=0
 
size_t getStreamIndex () const
 
size_t getStreamId () const
 
Rational getTimeBase () const
 
float getDuration () const
 in seconds More...
 
AVMediaType getStreamType () const
 
size_t getCodecId () const
 
std::string getCodecName () const
 
std::string getCodecLongName () const
 
const PropertyVectorgetMetadatas () const
 
const AVFormatContext & getAVFormatContext () const
 
std::string asJson () const
 Return all properties as a json format. More...
 
PropertyMap asMap () const
 Return all properties as a map (name of property, value) More...
 
PropertyVector asVector () const
 Same data with a specific order. More...
 

Private Member Functions

void analyseGopStructure (IProgress &progress)
 frame type / is key frame More...
 
template<typename T >
void addProperty (PropertyVector &dataVector, const std::string &key, T(VideoProperties::*getter)(void) const) const
 

Private Attributes

EAnalyseLevel _levelAnalysis
 Level of analysis asked. More...
 
PixelProperties _pixelProperties
 All the pixel properties contained in this stream. More...
 
int64_t _firstGopTimeCode
 GOP timecode of the first frame. More...
 
bool _isInterlaced
 
bool _isTopFieldFirst
 
size_t _gopSize
 
std::vector< std::pair< char,
int > > 
_gopStructure
 picture type, encoded frame size in bytes More...
 

Additional Inherited Members

- Protected Attributes inherited from avtranscoder::StreamProperties
const AVFormatContext * _formatContext
 Has link (no ownership) More...
 
AVCodecContext * _codecContext
 Has link (no ownership) More...
 
AVCodec * _codec
 Has link (no ownership) More...
 
size_t _streamIndex
 
PropertyVector _metadatas
 

Detailed Description

Definition at line 21 of file VideoProperties.hpp.

Constructor & Destructor Documentation

avtranscoder::VideoProperties::VideoProperties ( const FormatContext formatContext,
const size_t  index,
IProgress progress,
const EAnalyseLevel  level = eAnalyseLevelFirstGop 
)

Member Function Documentation

template<typename T >
void avtranscoder::VideoProperties::addProperty ( PropertyVector dataVector,
const std::string &  key,
T(VideoProperties::*)(void) const  getter 
) const
inlineprivate
void avtranscoder::VideoProperties::analyseGopStructure ( IProgress progress)
private
AVCodecContext& avtranscoder::VideoProperties::getAVCodecContext ( )
inline

Definition at line 81 of file VideoProperties.hpp.

Referenced by main().

std::string avtranscoder::VideoProperties::getChromaSampleLocation ( ) const

Definition at line 219 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector().

std::string avtranscoder::VideoProperties::getColorPrimaries ( ) const

Definition at line 185 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector().

std::string avtranscoder::VideoProperties::getColorRange ( ) const

Definition at line 165 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector().

std::string avtranscoder::VideoProperties::getColorspace ( ) const

Definition at line 120 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector().

std::string avtranscoder::VideoProperties::getColorTransfert ( ) const

Definition at line 56 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector().

Rational avtranscoder::VideoProperties::getDar ( ) const

Definition at line 307 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext, and getSar().

Referenced by fillVector().

size_t avtranscoder::VideoProperties::getDtgActiveFormat ( ) const

Definition at line 421 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector().

std::string avtranscoder::VideoProperties::getFieldOrder ( ) const

Definition at line 247 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector().

float avtranscoder::VideoProperties::getFps ( ) const

Corresponds to the 'fps' returned by ffprobe. fps = the average framerate that has come from the AVStream tbn = the time base in AVStream that has come from the AVStream tbc = the time base in AVCodecContext for the codec used for a particular stream tbr = tbr is guessed from the video stream and is the value users want to see when they look for the video frame rate.

Definition at line 449 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_formatContext, and avtranscoder::StreamProperties::_streamIndex.

Referenced by fillVector(), getBitRate(), getNbFrames(), and avtranscoder::Transcoder::getProfileFromFile().

size_t avtranscoder::VideoProperties::getGopSize ( ) const
inline
Returns
the distance between two nearest I frame

Definition at line 76 of file VideoProperties.hpp.

Referenced by fillVector(), and getBitRate().

std::vector<std::pair<char, int> > avtranscoder::VideoProperties::getGopStructure ( ) const
inline

Definition at line 77 of file VideoProperties.hpp.

size_t avtranscoder::VideoProperties::getHeight ( ) const
int avtranscoder::VideoProperties::getLevel ( ) const

Definition at line 442 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector().

size_t avtranscoder::VideoProperties::getMaxBitRate ( ) const

Definition at line 376 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector().

size_t avtranscoder::VideoProperties::getMinBitRate ( ) const

Definition at line 383 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector().

size_t avtranscoder::VideoProperties::getNbFrames ( ) const
PixelProperties& avtranscoder::VideoProperties::getPixelProperties ( )
inline

Definition at line 35 of file VideoProperties.hpp.

Referenced by avtranscoder::Transcoder::getProfileFromFile().

const PixelProperties& avtranscoder::VideoProperties::getPixelProperties ( ) const
inline

Definition at line 82 of file VideoProperties.hpp.

int avtranscoder::VideoProperties::getProfile ( ) const

Definition at line 435 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector(), and getProfileName().

std::string avtranscoder::VideoProperties::getProfileName ( ) const
size_t avtranscoder::VideoProperties::getReferencesFrames ( ) const

Definition at line 428 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector().

Rational avtranscoder::VideoProperties::getSar ( ) const

Definition at line 296 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector(), and getDar().

int64_t avtranscoder::VideoProperties::getStartTimecode ( ) const
std::string avtranscoder::VideoProperties::getStartTimecodeString ( ) const

Definition at line 278 of file VideoProperties.cpp.

References getStartTimecode().

Referenced by fillVector().

size_t avtranscoder::VideoProperties::getTicksPerFrame ( ) const

Definition at line 400 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector().

size_t avtranscoder::VideoProperties::getWidth ( ) const
bool avtranscoder::VideoProperties::hasBFrames ( ) const

Definition at line 454 of file VideoProperties.cpp.

References avtranscoder::StreamProperties::_codecContext.

Referenced by fillVector().

bool avtranscoder::VideoProperties::isInterlaced ( ) const
inline

Definition at line 71 of file VideoProperties.hpp.

Referenced by fillVector().

bool avtranscoder::VideoProperties::isTopFieldFirst ( ) const
inline

Definition at line 72 of file VideoProperties.hpp.

Referenced by fillVector().

Field Documentation

int64_t avtranscoder::VideoProperties::_firstGopTimeCode
private

GOP timecode of the first frame.

Note
AVCodecContext stores the GOP timecode of the last decoded frame

Definition at line 132 of file VideoProperties.hpp.

Referenced by getStartTimecode(), and VideoProperties().

size_t avtranscoder::VideoProperties::_gopSize
private

Definition at line 124 of file VideoProperties.hpp.

Referenced by analyseGopStructure().

std::vector<std::pair<char, int> > avtranscoder::VideoProperties::_gopStructure
private

picture type, encoded frame size in bytes

Definition at line 125 of file VideoProperties.hpp.

Referenced by analyseGopStructure(), and fillVector().

bool avtranscoder::VideoProperties::_isInterlaced
private

Definition at line 122 of file VideoProperties.hpp.

Referenced by analyseGopStructure().

bool avtranscoder::VideoProperties::_isTopFieldFirst
private

Definition at line 123 of file VideoProperties.hpp.

Referenced by analyseGopStructure().

EAnalyseLevel avtranscoder::VideoProperties::_levelAnalysis
private

Level of analysis asked.

Definition at line 113 of file VideoProperties.hpp.

Referenced by fillVector(), getBitRate(), and VideoProperties().

PixelProperties avtranscoder::VideoProperties::_pixelProperties
private

All the pixel properties contained in this stream.

Definition at line 118 of file VideoProperties.hpp.

Referenced by fillVector(), and VideoProperties().


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