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

Namespaces

 constants
 
 detail
 
 json
 

Data Structures

class  AttachementProperties
 
class  AudioCodec
 
class  AudioDecoder
 
class  AudioEncoder
 
class  AudioFrame
 This class describes decoded audio data. More...
 
struct  AudioFrameDesc
 Description to create an audio frame. This corresponds to the number of samples, which corresponds to one video frame. More...
 
class  AudioGenerator
 
class  AudioProperties
 
class  AudioReader
 
class  AudioStat
 Statistics related to an audio stream. More...
 
class  AudioTransform
 
struct  Channel
 
class  CodedData
 This class describes coded data. More...
 
class  ConsoleProgress
 Implementation of IProgress, to display a progress bar in console. More...
 
class  DataCodec
 
class  DataProperties
 
class  FileProperties
 
class  Filter
 Describe a filter and its options. More...
 
class  FilterGraph
 Manager of filters. More...
 
class  FormatContext
 Wrapper of an AVFormatContext. More...
 
class  Frame
 This class describes decoded (raw) audio or video data. More...
 
class  ICodec
 
class  IDecoder
 
class  IEncoder
 
class  IInputStream
 
class  InputFile
 
class  InputStream
 
class  IOutputFile
 IOutputfile is the interface to wrap and write medias. It can be overloaded to integrate custom wrapper. More...
 
class  IOutputStream
 
class  IProgress
 Base class of Progress. Inherit this class to have your own way to manage a progress bar. You can inherit this class in C++, but also in python / Java binding. More...
 
class  IReader
 Based class to read a stream. More...
 
class  ITransform
 
class  Library
 
class  Logger
 Logger class which contains static functions to use ffmpeg/libav log system. More...
 
class  NoDisplayProgress
 Implementation of IProgress, to manage cases when we need an IProgress but don't care of a progress bar. More...
 
class  Option
 Wrapper of AVOption. Get its type to know what the option is about: Int, Double, Ratio, Choice... Parse its array of options to get the potential childs (Choice and Group). More...
 
class  OutputFile
 Outputfile is the default implentation of wrapper which uses LibAV/FFMpeg. More...
 
class  OutputStream
 
class  PixelProperties
 
class  ProcessStat
 ProcessStat contains statistics given after the process. More...
 
class  ProfileLoader
 
class  StreamProperties
 Virtual based class of properties for all types of stream. More...
 
class  StreamTranscoder
 
class  SubtitleProperties
 
class  Transcoder
 A Transcoder manages a list of streams, and process a transcode to create an output media file. More...
 
class  UnknownProperties
 
class  VideoCodec
 
class  VideoDecoder
 
class  VideoEncoder
 
class  VideoFrame
 This class describes decoded video data. More...
 
struct  VideoFrameDesc
 Description to create a video frame. More...
 
class  VideoGenerator
 
class  VideoProperties
 
class  VideoReader
 
class  VideoStat
 Statistics related to a video stream. More...
 
class  VideoTransform
 

Typedefs

typedef AVRational Rational
 
typedef std::vector< LibraryLibraries
 
typedef std::vector< OptionOptionArray
 
typedef std::map< std::string,
Option
OptionMap
 Key: option name / value: option. More...
 
typedef std::vector< std::pair
< std::string, std::string > > 
PropertyVector
 PropertyVector is a vector of pair, because the order of properties matters to us. More...
 
typedef std::map< std::string,
std::string > 
PropertyMap
 
typedef std::map< std::string,
OptionArray
OptionArrayMap
 
typedef std::map< std::string,
std::string > 
NamesMap
 

Enumerations

enum  ECodecType { eCodecTypeEncoder, eCodecTypeDecoder }
 Define if a codec is for encoding or decoding. More...
 
enum  EAnalyseLevel { eAnalyseLevelHeader = 0, eAnalyseLevelFirstGop = 1 }
 Level of file analysis. More...
 
enum  EOptionBaseType {
  eOptionBaseTypeBool, eOptionBaseTypeInt, eOptionBaseTypeDouble, eOptionBaseTypeString,
  eOptionBaseTypeRatio, eOptionBaseTypeChoice, eOptionBaseTypeGroup, eOptionBaseTypeChild,
  eOptionBaseTypeUnknown
}
 
enum  EJobStatus { eJobStatusContinue = 0, eJobStatusCancel }
 Indicate the state of a process. More...
 
enum  EComponentType {
  eComponentGray = 0, eComponentRgb, eComponentYuv, eComponentYuvJPEG,
  eComponentYuvA
}
 
enum  ESubsamplingType {
  eSubsamplingNone = 0, eSubsampling440, eSubsampling422, eSubsampling420,
  eSubsampling411, eSubsampling410
}
 
enum  EProcessMethod {
  eProcessMethodShortest = 0, eProcessMethodLongest, eProcessMethodBasedOnStream, eProcessMethodBasedOnDuration,
  eProcessMethodInfinity
}
 Enum to set a policy of how we manage the process in case of several streams. eProcessMethodShortest: stop the process at the end of the shortest stream. eProcessMethodLongest: stop the process at the end of the longest stream. eProcessMethodBasedOnStream: stop the process at the end of an indicated stream (. More...
 

Functions

void preloadCodecsAndFormats ()
 Register all the codecs and formats which are enabled at configuration time. More...
 
std::string getDescriptionFromErrorCode (const int code)
 Get the string description corresponding to the error code provided by ffmpeg/libav. More...
 
std::ostream & operator<< (std::ostream &flux, const InputFile &input)
 
Libraries getLibraries ()
 
std::vector< std::string > getInputExtensions ()
 
std::vector< std::string > getOutputExtensions ()
 
void callbackToWriteInFile (void *ptr, int level, const char *fmt, va_list vl)
 
void loadOptions (OptionMap &outOptions, void *av_class, int req_flags)
 
void loadOptions (OptionArray &outOptions, void *av_class, int req_flags)
 
std::ostream & operator<< (std::ostream &os, const ProfileLoader::Profile &profile)
 
void split (std::vector< std::string > &splitString, const std::string &inputString, const std::string &splitChars)
 
int getFilesInDir (const std::string &dir, std::vector< std::string > &files)
 
std::ostream & operator<< (std::ostream &flux, const AttachementProperties &attachementProperties)
 
std::ostream & operator<< (std::ostream &flux, const AudioProperties &audioProperties)
 
std::ostream & operator<< (std::ostream &flux, const DataProperties &dataProperties)
 
std::ostream & operator<< (std::ostream &flux, const FileProperties &fileProperties)
 
std::ostream & operator<< (std::ostream &flux, const StreamProperties &streamProperties)
 
std::ostream & operator<< (std::ostream &flux, const SubtitleProperties &subtitleProperties)
 
std::ostream & operator<< (std::ostream &flux, const UnknownProperties &unknownProperties)
 
std::ostream & operator<< (std::ostream &flux, const VideoProperties &videoProperties)
 
std::vector< std::string > getSupportedPixelFormats (const std::string &videoCodecName="")
 Get pixel format supported by a video codec. More...
 
std::vector< std::string > getSupportedSampleFormats (const std::string &audioCodecName="")
 Get sample format supported by an audio codec. More...
 
AVPixelFormat getAVPixelFormat (const std::string &pixelFormat)
 Get the corresponding AVPixelFormat from the pixel format name. More...
 
AVSampleFormat getAVSampleFormat (const std::string &sampleFormat)
 Get the corresponding AVSampleFormat from the sample format name. More...
 
std::string getPixelFormatName (const AVPixelFormat pixelFormat)
 
std::string getSampleFormatName (const AVSampleFormat sampleFormat)
 
std::vector< AVOutputFormat * > getAvailableFormats ()
 
NamesMap getAvailableFormatsNames ()
 Get a map of short/long names of all formats available in FFmpeg / libav. More...
 
NamesMap getAvailableVideoFormatsNames ()
 Get a map of short/long names of all formats dedicate for video available in FFmpeg / libav. More...
 
NamesMap getAvailableAudioFormatsNames ()
 Get a map of short/long names of all formats dedicate for video available in FFmpeg / libav. More...
 
std::vector< AVCodec * > getAvailableCodecs ()
 
NamesMap getAvailableVideoCodecsNames ()
 Get a map of short/long names of all video codecs available in FFmpeg / libav. More...
 
NamesMap getAvailableAudioCodecsNames ()
 Get a map of short/long names of all audio codecs available in FFmpeg / libav. More...
 
OptionArrayMap getAvailableOptionsPerOutputFormat ()
 Get the list of options for each output format. More...
 
OptionArrayMap getAvailableOptionsPerVideoCodec ()
 Get the list of options for each video codec. More...
 
OptionArrayMap getAvailableOptionsPerAudioCodec ()
 Get the list of options for each audio codec. More...
 

Typedef Documentation

typedef std::vector<Library> avtranscoder::Libraries

Definition at line 36 of file Library.hpp.

typedef std::map<std::string, std::string> avtranscoder::NamesMap

Definition at line 22 of file util.hpp.

typedef std::vector<Option> avtranscoder::OptionArray

Definition at line 118 of file Option.hpp.

typedef std::map<std::string, OptionArray> avtranscoder::OptionArrayMap

Definition at line 21 of file util.hpp.

typedef std::map<std::string, Option> avtranscoder::OptionMap

Key: option name / value: option.

Definition at line 119 of file Option.hpp.

typedef std::map<std::string, std::string> avtranscoder::PropertyMap

Definition at line 24 of file util.hpp.

typedef std::vector<std::pair<std::string, std::string> > avtranscoder::PropertyVector

PropertyVector is a vector of pair, because the order of properties matters to us.

Definition at line 23 of file util.hpp.

typedef AVRational avtranscoder::Rational

Definition at line 55 of file common.hpp.

Enumeration Type Documentation

Level of file analysis.

Enumerator
eAnalyseLevelHeader 
eAnalyseLevelFirstGop 

Definition at line 10 of file util.hpp.

Define if a codec is for encoding or decoding.

Enumerator
eCodecTypeEncoder 
eCodecTypeDecoder 

Definition at line 19 of file ICodec.hpp.

Enumerator
eComponentGray 

Gray color space.

eComponentRgb 

RGB color space.

eComponentYuv 

YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240.

eComponentYuvJPEG 

YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255.

eComponentYuvA 

YUV color space with transparency.

Definition at line 20 of file PixelProperties.hpp.

Indicate the state of a process.

Enumerator
eJobStatusContinue 
eJobStatusCancel 

Definition at line 12 of file IProgress.hpp.

Enumerator
eOptionBaseTypeBool 
eOptionBaseTypeInt 
eOptionBaseTypeDouble 
eOptionBaseTypeString 
eOptionBaseTypeRatio 
eOptionBaseTypeChoice 
eOptionBaseTypeGroup 
eOptionBaseTypeChild 
eOptionBaseTypeUnknown 

Definition at line 18 of file Option.hpp.

Enum to set a policy of how we manage the process in case of several streams. eProcessMethodShortest: stop the process at the end of the shortest stream. eProcessMethodLongest: stop the process at the end of the longest stream. eProcessMethodBasedOnStream: stop the process at the end of an indicated stream (.

See also
_indexBasedStream attribute of Transcoder). eProcessMethodBasedOnDuration: stop the process at the end of an indicated duration, in seconds (
_outputDuration attribute of Transcoder). eProcessMethodInfinity: stop the process by outside of avTranscoder (streaming mode)
Enumerator
eProcessMethodShortest 
eProcessMethodLongest 
eProcessMethodBasedOnStream 
eProcessMethodBasedOnDuration 
eProcessMethodInfinity 

Definition at line 29 of file Transcoder.hpp.

Enumerator
eSubsamplingNone 
eSubsampling440 
eSubsampling422 
eSubsampling420 
eSubsampling411 
eSubsampling410 

Definition at line 29 of file PixelProperties.hpp.

Function Documentation

void avtranscoder::callbackToWriteInFile ( void *  ptr,
int  level,
const char *  fmt,
va_list  vl 
)

Definition at line 8 of file log.cpp.

References LOG_FILE.

Referenced by avtranscoder::Logger::logInFile().

NamesMap AvExport avtranscoder::getAvailableAudioCodecsNames ( )

Get a map of short/long names of all audio codecs available in FFmpeg / libav.

Note
Need to call preloadCodecsAndFormats before using this function.

Definition at line 199 of file util.cpp.

References getAvailableCodecs().

NamesMap AvExport avtranscoder::getAvailableAudioFormatsNames ( )

Get a map of short/long names of all formats dedicate for video available in FFmpeg / libav.

Note
Need to call preloadCodecsAndFormats before using this function.

Definition at line 154 of file util.cpp.

References AV_CODEC_ID_NONE, and getAvailableFormats().

std::vector< AVCodec * > avtranscoder::getAvailableCodecs ( )
Returns
The list of all codecs available in FFmpeg / libav.

Definition at line 169 of file util.cpp.

Referenced by getAvailableAudioCodecsNames(), and getAvailableVideoCodecsNames().

std::vector< AVOutputFormat * > avtranscoder::getAvailableFormats ( )
Returns
The list of all formats available in FFmpeg / libav.

Definition at line 112 of file util.cpp.

Referenced by getAvailableAudioFormatsNames(), getAvailableFormatsNames(), and getAvailableVideoFormatsNames().

NamesMap AvExport avtranscoder::getAvailableFormatsNames ( )

Get a map of short/long names of all formats available in FFmpeg / libav.

Note
Need to call preloadCodecsAndFormats before using this function.

Definition at line 127 of file util.cpp.

References getAvailableFormats().

OptionArrayMap AvExport avtranscoder::getAvailableOptionsPerAudioCodec ( )

Get the list of options for each audio codec.

Note
Need to call preloadCodecsAndFormats before using this function.

Definition at line 266 of file util.cpp.

References loadOptions().

OptionArrayMap AvExport avtranscoder::getAvailableOptionsPerOutputFormat ( )

Get the list of options for each output format.

Note
Need to call preloadCodecsAndFormats before using this function.

Definition at line 214 of file util.cpp.

References loadOptions().

OptionArrayMap AvExport avtranscoder::getAvailableOptionsPerVideoCodec ( )

Get the list of options for each video codec.

Note
Need to call preloadCodecsAndFormats before using this function.

Definition at line 238 of file util.cpp.

References loadOptions().

NamesMap AvExport avtranscoder::getAvailableVideoCodecsNames ( )

Get a map of short/long names of all video codecs available in FFmpeg / libav.

Note
Need to call preloadCodecsAndFormats before using this function.

Definition at line 184 of file util.cpp.

References getAvailableCodecs().

NamesMap AvExport avtranscoder::getAvailableVideoFormatsNames ( )

Get a map of short/long names of all formats dedicate for video available in FFmpeg / libav.

Note
Need to call preloadCodecsAndFormats before using this function.

Definition at line 139 of file util.cpp.

References AV_CODEC_ID_NONE, and getAvailableFormats().

AVPixelFormat AvExport avtranscoder::getAVPixelFormat ( const std::string &  pixelFormat)

Get the corresponding AVPixelFormat from the pixel format name.

Parameters
pixelFormatthe name of the pixel format

Definition at line 90 of file util.cpp.

Referenced by avtranscoder::VideoGenerator::decodeNextFrame(), and avtranscoder::VideoFrameDesc::setParameters().

AVSampleFormat AvExport avtranscoder::getAVSampleFormat ( const std::string &  sampleFormat)

Get the corresponding AVSampleFormat from the sample format name.

Parameters
sampleFormatthe name of the sample format

Definition at line 95 of file util.cpp.

Referenced by avtranscoder::AudioFrameDesc::setParameters(), and avtranscoder::AudioReader::updateOutput().

int avtranscoder::getFilesInDir ( const std::string &  dir,
std::vector< std::string > &  files 
)

Definition at line 47 of file util.hpp.

Referenced by avtranscoder::ProfileLoader::loadProfiles().

std::vector< std::string > AvExport avtranscoder::getInputExtensions ( )

Definition at line 105 of file Library.cpp.

Referenced by main().

Libraries AvExport avtranscoder::getLibraries ( )

Definition at line 78 of file Library.cpp.

References AVTRANSCODER_VERSION_MAJOR, AVTRANSCODER_VERSION_MICRO, and AVTRANSCODER_VERSION_MINOR.

Referenced by main().

std::vector< std::string > AvExport avtranscoder::getOutputExtensions ( )

Definition at line 143 of file Library.cpp.

Referenced by main().

std::string AvExport avtranscoder::getPixelFormatName ( const AVPixelFormat  pixelFormat)
Returns
The name of the given pixel format.
Note
Returns an empty string if the format is not found.

Definition at line 100 of file util.cpp.

Referenced by avtranscoder::FilterGraph::pushInBuffer().

std::string AvExport avtranscoder::getSampleFormatName ( const AVSampleFormat  sampleFormat)
Returns
The name of the given sample format.
Note
Returns an empty string if the format is not found.

Definition at line 106 of file util.cpp.

Referenced by avtranscoder::AudioFrame::allocateAVSample(), avtranscoder::AudioGenerator::decodeNextFrame(), avtranscoder::AudioTransform::init(), and avtranscoder::FilterGraph::pushInBuffer().

std::vector< std::string > AvExport avtranscoder::getSupportedPixelFormats ( const std::string &  videoCodecName = "")

Get pixel format supported by a video codec.

Parameters
videoCodecNamethe video codec name (empty if not indicated, and so get all pixel formats supported by all video codecs).

Definition at line 13 of file util.cpp.

std::vector< std::string > AvExport avtranscoder::getSupportedSampleFormats ( const std::string &  audioCodecName = "")

Get sample format supported by an audio codec.

Parameters
audioCodecNamethe audio codec name (empty if not indicated, and so get all sample formats supported by all audio codecs).

Definition at line 58 of file util.cpp.

void AvExport avtranscoder::loadOptions ( OptionMap &  outOptions,
void *  av_class,
int  req_flags = 0 
)
void AvExport avtranscoder::loadOptions ( OptionArray &  outOptions,
void *  av_class,
int  req_flags 
)

Definition at line 295 of file Option.cpp.

References loadOptions().

AvExport std::ostream & avtranscoder::operator<< ( std::ostream &  flux,
const SubtitleProperties &  subtitleProperties 
)
AvExport std::ostream & avtranscoder::operator<< ( std::ostream &  flux,
const AttachementProperties &  attachementProperties 
)
AvExport std::ostream & avtranscoder::operator<< ( std::ostream &  flux,
const UnknownProperties &  unknownProperties 
)
AvExport std::ostream & avtranscoder::operator<< ( std::ostream &  flux,
const DataProperties &  dataProperties 
)
AvExport std::ostream & avtranscoder::operator<< ( std::ostream &  flux,
const StreamProperties &  streamProperties 
)
AvExport std::ostream & avtranscoder::operator<< ( std::ostream &  flux,
const AudioProperties &  audioProperties 
)
std::ostream & avtranscoder::operator<< ( std::ostream &  os,
const ProfileLoader::Profile &  profile 
)

Definition at line 222 of file ProfileLoader.cpp.

AvExport std::ostream & avtranscoder::operator<< ( std::ostream &  flux,
const FileProperties &  fileProperties 
)
std::ostream& avtranscoder::operator<< ( std::ostream &  flux,
const VideoProperties &  videoProperties 
)
void AvExport avtranscoder::preloadCodecsAndFormats ( )

Register all the codecs and formats which are enabled at configuration time.

Definition at line 16 of file common.cpp.

Referenced by main().

void avtranscoder::split ( std::vector< std::string > &  splitString,
const std::string &  inputString,
const std::string &  splitChars 
)