avcpp 3.2.1
Wrapper for the FFmpeg that simplify usage from C++ projects.
Loading...
Searching...
No Matches
av::OutputFormat Class Reference

Muxer descriptor. More...

#include <format.h>

Inheritance diagram for av::OutputFormat:

Public Member Functions

 OutputFormat (const std::string &name, const std::string &url=std::string(), const std::string &mime=std::string()) noexcept
 Look a muxer up by name, URL or MIME type.
bool setFormat (const std::string &name, const std::string &url=std::string(), const std::string &mime=std::string()) noexcept
 Look a muxer up and point the descriptor at it.
AVCodecID defaultVideoCodecId () const noexcept
 Video codec the muxer uses when the caller does not choose one.
AVCodecID defaultAudioCodecId () const noexcept
 Audio codec the muxer uses when the caller does not choose one.
Public Member Functions inherited from av::Format< avcpp_format_const< AVOutputFormat > >
const char * name () const noexcept
 Short format name, as FFmpeg spells it.
const char * longName () const noexcept
 Human-readable format name.
int32_t flags () const noexcept
 Raw AVFMT_* flags of the format.
bool isFlags (int32_t flags) const noexcept
 Whether all given flags are set.
void setFormat (avcpp_format_const< AVOutputFormat > *format) noexcept
 Point the descriptor at another format.
bool codecSupported (const class Codec &codec) const noexcept
 Whether the format can carry a codec.
Public Member Functions inherited from FFWrapperPtr< avcpp_format_const< AVOutputFormat > >
 FFWrapperPtr ()=default
 Create an empty wrapper; isNull() is true.
const avcpp_format_const< AVOutputFormat > * raw () const
 Read access to the wrapped object.
void reset (avcpp_format_const< AVOutputFormat > *raw=nullptr)
 Replace the stored pointer.
bool isNull () const
 Whether the wrapper is empty.
void _log (int level, const char *fmt) const
 Log through the FFmpeg log system, using this wrapper as the context.

Additional Inherited Members

Protected Attributes inherited from FFWrapperPtr< avcpp_format_const< AVOutputFormat > >
avcpp_format_const< AVOutputFormat > * m_raw
 The wrapped pointer; owned by the derived class, not by this template.

Detailed Description

Wraps the FFmpeg structure that describes a container writer. Besides the lookup, it reports the codecs the muxer falls back to when the caller does not choose one.

Examples
api2-decode-encode-audio.cpp, api2-decode-encode-video.cpp, api2-decode-filter-encode.cpp, api2-decode-overlay-encode.cpp, api2-hw-encode.cpp, api2-hw-scale.cpp, api2-hw-transcode.cpp, api2-remux.cpp, and api2-scale-video.cpp.

Constructor & Destructor Documentation

◆ OutputFormat()

av::OutputFormat::OutputFormat ( const std::string & name,
const std::string & url = std::string(),
const std::string & mime = std::string() )
noexcept
Parameters
namemuxer name, for example "mp4"
urlURL that hints at the format; may be empty
mimeMIME type that hints at the format; may be empty

Member Function Documentation

◆ defaultAudioCodecId()

AVCodecID av::OutputFormat::defaultAudioCodecId ( ) const
noexcept
Returns
the AV_CODEC_ID_* value, or AV_CODEC_ID_NONE

◆ defaultVideoCodecId()

AVCodecID av::OutputFormat::defaultVideoCodecId ( ) const
noexcept
Returns
the AV_CODEC_ID_* value, or AV_CODEC_ID_NONE

◆ setFormat()

bool av::OutputFormat::setFormat ( const std::string & name,
const std::string & url = std::string(),
const std::string & mime = std::string() )
noexcept
Parameters
namemuxer name
urlURL that hints at the format; may be empty
mimeMIME type that hints at the format; may be empty
Returns
true when a muxer was found
Examples
api2-decode-encode-video.cpp, api2-decode-filter-encode.cpp, api2-decode-overlay-encode.cpp, api2-hw-encode.cpp, api2-hw-scale.cpp, api2-hw-transcode.cpp, and api2-scale-video.cpp.

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