FFmpegfs Fuse Multi Media Filesystem 2.16
Classes | Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
Format_Options Struct Reference

#include <ffmpeg_utils.h>

Classes

struct  _tagFORMAT
 

Public Types

typedef std::vector< AVCodecID > CODEC_VECT
 Vector with valid codec ids for file format. More...
 
typedef struct Format_Options::_tagFORMAT FORMAT
 
typedef std::map< SAMPLE_FMT, const FORMATFORMAT_MAP
 Map of formats. One entry per format derivative. More...
 

Public Member Functions

 Format_Options ()
 Construct Format_Options object with defaults (empty) More...
 
 Format_Options (std::string format_name, std::string fileext, FORMAT_MAP format, bool albumart_supported)
 Construct Format_Options object. More...
 
const std::string & format_name () const
 Convert destination type to "real" type, i.e., the file extension to be used. More...
 
const std::string & fileext () const
 Get file extension. More...
 
AVCodecID video_codec () const
 Get video codec_id. More...
 
bool is_video_codec_supported (AVCodecID codec_id) const
 Check if video codec/file format combination is supported. More...
 
std::string video_codec_list () const
 Create a list of supported audio codecs for current audio codec. More...
 
AVCodecID audio_codec () const
 Get audio codec_id. More...
 
bool is_audio_codec_supported (AVCodecID codec_id) const
 Check if audio codec/file format combination is supported. More...
 
std::string audio_codec_list () const
 Create a list of supported audio codecs for current audio codec. More...
 
AVSampleFormat sample_format () const
 Get sample format (bit width) More...
 
bool is_sample_fmt_supported () const
 Check if audio codec/sample format combination is supported. More...
 
std::string sample_fmt_list () const
 Create a list of supported sample formats for current audio codec. More...
 
AVCodecID subtitle_codec (AVCodecID codec_id) const
 Get subtitle codec_id. More...
 

Protected Attributes

std::string m_format_name
 Descriptive name of the format. Descriptive name of the format, e.g. "opus", "mpegts". Please note that m_format_name is used to select the FFmpeg container by passing it to avformat_alloc_output_context2(). Mostly, but not always, same as m_fileext. More...
 
std::string m_fileext
 File extension: mp4, mp3, flac or other. Mostly, but not always, same as m_format_name. More...
 
FORMAT_MAP m_format_map
 Format definition (audio/videocodec, sample format) More...
 
bool m_albumart_supported
 true if album arts are supported (eg. mp3) or false if not (e.g. wav, aiff) More...
 

Friends

class FFmpegfs_Format
 

Detailed Description

Format options: Defines file extension, codecs etc. for each format.

Definition at line 262 of file ffmpeg_utils.h.

Member Typedef Documentation

◆ CODEC_VECT

typedef std::vector<AVCodecID> Format_Options::CODEC_VECT

Vector with valid codec ids for file format.

Definition at line 266 of file ffmpeg_utils.h.

◆ FORMAT

Format options: Audio/video codecs and sample format

◆ FORMAT_MAP

typedef std::map<SAMPLE_FMT, const FORMAT> Format_Options::FORMAT_MAP

Map of formats. One entry per format derivative.

Definition at line 279 of file ffmpeg_utils.h.

Constructor & Destructor Documentation

◆ Format_Options() [1/2]

Format_Options::Format_Options ( )

Construct Format_Options object with defaults (empty)

Definition at line 124 of file ffmpeg_utils.cc.

References FMT_DONTCARE.

◆ Format_Options() [2/2]

Format_Options::Format_Options ( std::string  format_name,
std::string  fileext,
FORMAT_MAP  format,
bool  albumart_supported 
)

Construct Format_Options object.

Parameters
[in]format_name- Descriptive name of the format, e.g. "Opus Audio",
[in]fileext- File extension: mp4, mp3, flac or other
[in]format- Format options: Possible audio/video codecs and sample formats
[in]albumart_supported- true if album arts are supported (eg. mp3) or false if not (e.g. wav, aiff

Definition at line 130 of file ffmpeg_utils.cc.

Member Function Documentation

◆ audio_codec()

AVCodecID Format_Options::audio_codec ( ) const

Get audio codec_id.

Returns
Returns audio codec_id

Definition at line 197 of file ffmpeg_utils.cc.

References FFMPEGFS_PARAMS::m_audio_codec, m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.

Referenced by FFmpegfs_Format::audio_codec().

◆ audio_codec_list()

std::string Format_Options::audio_codec_list ( ) const

Create a list of supported audio codecs for current audio codec.

Returns
Returns comma separated list of formats, or empty if not available.

Definition at line 230 of file ffmpeg_utils.cc.

References get_audio_codec_text(), m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.

Referenced by FFmpegfs_Format::audio_codec_list().

◆ fileext()

const std::string & Format_Options::fileext ( ) const

Get file extension.

Returns
File extension

◆ format_name()

const std::string & Format_Options::format_name ( ) const

Convert destination type to "real" type, i.e., the file extension to be used.

Note
Currently "prores" is mapped to "mov".
Returns
Destination type

◆ is_audio_codec_supported()

bool Format_Options::is_audio_codec_supported ( AVCodecID  codec_id) const

Check if audio codec/file format combination is supported.

Parameters
[in]codec_id- Codec ID to check
Returns
Returns true if supported, false if not.

Definition at line 214 of file ffmpeg_utils.cc.

References m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.

Referenced by FFmpegfs_Format::is_audio_codec_supported().

◆ is_sample_fmt_supported()

bool Format_Options::is_sample_fmt_supported ( ) const

Check if audio codec/sample format combination is supported.

Returns
Returns true if supported, false if not.

Definition at line 261 of file ffmpeg_utils.cc.

References m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.

Referenced by FFmpegfs_Format::is_sample_fmt_supported().

◆ is_video_codec_supported()

bool Format_Options::is_video_codec_supported ( AVCodecID  codec_id) const

Check if video codec/file format combination is supported.

Parameters
[in]codec_id- Codec ID to check
Returns
Returns true if supported, false if not.

Definition at line 161 of file ffmpeg_utils.cc.

References m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.

Referenced by FFmpegfs_Format::is_video_codec_supported().

◆ sample_fmt_list()

std::string Format_Options::sample_fmt_list ( ) const

Create a list of supported sample formats for current audio codec.

Returns
Returns comma separated list of formats, or empty if not available.

Definition at line 267 of file ffmpeg_utils.cc.

References get_sampleformat_text(), and m_format_map.

Referenced by FFmpegfs_Format::sample_fmt_list().

◆ sample_format()

AVSampleFormat Format_Options::sample_format ( ) const

Get sample format (bit width)

Returns
Returns sample format

Definition at line 250 of file ffmpeg_utils.cc.

References m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.

Referenced by FFmpegfs_Format::sample_format().

◆ subtitle_codec()

AVCodecID Format_Options::subtitle_codec ( AVCodecID  codec_id) const

Get subtitle codec_id.

Parameters
[in]codec_id- Input stream codec ID
Returns
Returns subtitle codec_id that matches the input stream codec ID, or AV_CODEC_ID_NONE of no match.

Definition at line 283 of file ffmpeg_utils.cc.

References is_text_codec(), m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.

Referenced by FFmpegfs_Format::subtitle_codec().

◆ video_codec()

AVCodecID Format_Options::video_codec ( ) const

Get video codec_id.

Returns
Returns video codec_id

Definition at line 144 of file ffmpeg_utils.cc.

References m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, FFMPEGFS_PARAMS::m_video_codec, and params.

Referenced by FFmpegfs_Format::video_codec().

◆ video_codec_list()

std::string Format_Options::video_codec_list ( ) const

Create a list of supported audio codecs for current audio codec.

Returns
Returns comma separated list of formats, or empty if not available.

Definition at line 177 of file ffmpeg_utils.cc.

References get_video_codec_text(), m_format_map, FFMPEGFS_PARAMS::m_sample_fmt, and params.

Referenced by FFmpegfs_Format::video_codec_list().

Friends And Related Function Documentation

◆ FFmpegfs_Format

friend class FFmpegfs_Format
friend

Definition at line 264 of file ffmpeg_utils.h.

Member Data Documentation

◆ m_albumart_supported

bool Format_Options::m_albumart_supported
protected

true if album arts are supported (eg. mp3) or false if not (e.g. wav, aiff)

Definition at line 381 of file ffmpeg_utils.h.

Referenced by FFmpegfs_Format::albumart_supported().

◆ m_fileext

std::string Format_Options::m_fileext
protected

File extension: mp4, mp3, flac or other. Mostly, but not always, same as m_format_name.

Definition at line 379 of file ffmpeg_utils.h.

Referenced by FFmpegfs_Format::fileext().

◆ m_format_map

FORMAT_MAP Format_Options::m_format_map
protected

◆ m_format_name

std::string Format_Options::m_format_name
protected

Descriptive name of the format. Descriptive name of the format, e.g. "opus", "mpegts". Please note that m_format_name is used to select the FFmpeg container by passing it to avformat_alloc_output_context2(). Mostly, but not always, same as m_fileext.

Definition at line 378 of file ffmpeg_utils.h.

Referenced by FFmpegfs_Format::format_name().


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