FFmpegfs Fuse Multi Media Filesystem 2.16
Public Member Functions | Protected Attributes | Static Protected Attributes | Private Types | List of all members
FFmpegfs_Format Class Reference

The FFmpegfs_Format class. More...

#include <ffmpeg_utils.h>

Collaboration diagram for FFmpegfs_Format:
Collaboration graph
[legend]

Public Member Functions

 FFmpegfs_Format ()
 Construct FFmpegfs_Format object. More...
 
bool init (const std::string &desttype)
 Get codecs for the selected destination type. 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 & desttype () const
 Get destination type. More...
 
const std::string & fileext () const
 Get file extension. More...
 
FILETYPE filetype () const
 Get selected filetype. 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...
 
bool is_multiformat () const
 Check if this is some sort of multi file format (any of the following: is_frameset() or is_hls()). More...
 
bool is_frameset () const
 Check for an export frame format. More...
 
bool is_hls () const
 Check for HLS format. More...
 
bool albumart_supported () const
 Check if album arts are supported. More...
 

Protected Attributes

const Format_Options m_empty_options
 Set of empty (invalid) options as default. More...
 
const Format_Optionsm_cur_opts
 Currently selected options. Will never be nullptr. More...
 
std::string m_desttype
 Destination type: mp4, mp3 or other. More...
 
FILETYPE m_filetype
 File type, MP3, MP4, OPUS etc. More...
 

Static Protected Attributes

static const OPTIONS_MAP m_options_map
 Map of options. One entry per supported destination type. More...
 

Private Types

typedef std::map< FILETYPE, const Format_OptionsOPTIONS_MAP
 Map of options. One entry per supported destination type. More...
 

Detailed Description

The FFmpegfs_Format class.

Definition at line 387 of file ffmpeg_utils.h.

Member Typedef Documentation

◆ OPTIONS_MAP

typedef std::map<FILETYPE, const Format_Options> FFmpegfs_Format::OPTIONS_MAP
private

Map of options. One entry per supported destination type.

Definition at line 389 of file ffmpeg_utils.h.

Constructor & Destructor Documentation

◆ FFmpegfs_Format()

FFmpegfs_Format::FFmpegfs_Format ( )

Construct FFmpegfs_Format object.

Definition at line 862 of file ffmpeg_utils.cc.

Member Function Documentation

◆ albumart_supported()

bool FFmpegfs_Format::albumart_supported ( ) const

Check if album arts are supported.

Returns
true if album arts are supported or false if not

Definition at line 928 of file ffmpeg_utils.cc.

References Format_Options::m_albumart_supported, and m_cur_opts.

Referenced by FFmpeg_Transcoder::open_output_filestreams().

◆ audio_codec()

AVCodecID FFmpegfs_Format::audio_codec ( ) const

◆ audio_codec_list()

std::string FFmpegfs_Format::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 958 of file ffmpeg_utils.cc.

References Format_Options::audio_codec_list(), and m_cur_opts.

◆ desttype()

const std::string & FFmpegfs_Format::desttype ( ) const

◆ fileext()

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

Get file extension.

Returns
File extension

Definition at line 903 of file ffmpeg_utils.cc.

References m_cur_opts, and Format_Options::m_fileext.

Referenced by FFmpeg_Transcoder::encode_finish(), ffmpegfs_getattr(), ffmpegfs_readdir(), load_path(), make_hls_fileset(), and virtual_name().

◆ filetype()

FILETYPE FFmpegfs_Format::filetype ( ) const

◆ format_name()

const std::string & FFmpegfs_Format::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

Definition at line 898 of file ffmpeg_utils.cc.

References m_cur_opts, and Format_Options::m_format_name.

Referenced by FFmpeg_Transcoder::open_output_filestreams().

◆ init()

bool FFmpegfs_Format::init ( const std::string &  desttype)

Get codecs for the selected destination type.

Parameters
[in]desttype- Destination type (MP4, WEBM etc.).
Returns
Returns true if format was found; false if not.

Definition at line 869 of file ffmpeg_utils.cc.

References desttype(), get_filetype(), m_desttype, m_filetype, and m_options_map.

◆ is_audio_codec_supported()

bool FFmpegfs_Format::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 953 of file ffmpeg_utils.cc.

References Format_Options::is_audio_codec_supported(), and m_cur_opts.

◆ is_frameset()

bool FFmpegfs_Format::is_frameset ( ) const

Check for an export frame format.

Returns
Returns true for formats that export all frames as images.

Definition at line 918 of file ffmpeg_utils.cc.

References m_filetype.

Referenced by ffmpegfs_getattr(), ffmpegfs_readdir(), FFmpeg_Transcoder::is_frameset(), and is_multiformat().

◆ is_hls()

bool FFmpegfs_Format::is_hls ( ) const

Check for HLS format.

Returns
Returns true for formats that create an HLS set including the m3u file.

Definition at line 923 of file ffmpeg_utils.cc.

References m_filetype.

Referenced by ffmpegfs_getattr(), ffmpegfs_readdir(), FFmpeg_Transcoder::is_hls(), and is_multiformat().

◆ is_multiformat()

bool FFmpegfs_Format::is_multiformat ( ) const

Check if this is some sort of multi file format (any of the following: is_frameset() or is_hls()).

Returns
Returns true for a multi file format.

Definition at line 913 of file ffmpeg_utils.cc.

References is_frameset(), and is_hls().

Referenced by ffmpegfs_getattr(), ffmpegfs_readdir(), FFmpeg_Transcoder::is_multiformat(), and virtual_name().

◆ is_sample_fmt_supported()

bool FFmpegfs_Format::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 968 of file ffmpeg_utils.cc.

References Format_Options::is_sample_fmt_supported(), and m_cur_opts.

◆ is_video_codec_supported()

bool FFmpegfs_Format::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 938 of file ffmpeg_utils.cc.

References Format_Options::is_video_codec_supported(), and m_cur_opts.

◆ sample_fmt_list()

std::string FFmpegfs_Format::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 973 of file ffmpeg_utils.cc.

References m_cur_opts, and Format_Options::sample_fmt_list().

◆ sample_format()

AVSampleFormat FFmpegfs_Format::sample_format ( ) const

Get sample format (bit width)

Returns
Returns sample format

Definition at line 963 of file ffmpeg_utils.cc.

References m_cur_opts, and Format_Options::sample_format().

Referenced by FFmpeg_Transcoder::add_stream().

◆ subtitle_codec()

AVCodecID FFmpegfs_Format::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 978 of file ffmpeg_utils.cc.

References m_cur_opts, and Format_Options::subtitle_codec().

Referenced by FFmpeg_Transcoder::add_external_subtitle_stream(), FFmpeg_Transcoder::add_subtitle_streams(), and FFmpeg_Transcoder::open_subtitles().

◆ video_codec()

AVCodecID FFmpegfs_Format::video_codec ( ) const

◆ video_codec_list()

std::string FFmpegfs_Format::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 943 of file ffmpeg_utils.cc.

References m_cur_opts, and Format_Options::video_codec_list().

Member Data Documentation

◆ m_cur_opts

const Format_Options* FFmpegfs_Format::m_cur_opts
protected

◆ m_desttype

std::string FFmpegfs_Format::m_desttype
protected

Destination type: mp4, mp3 or other.

Definition at line 508 of file ffmpeg_utils.h.

Referenced by desttype(), and init().

◆ m_empty_options

const Format_Options FFmpegfs_Format::m_empty_options
protected

Set of empty (invalid) options as default.

Definition at line 505 of file ffmpeg_utils.h.

◆ m_filetype

FILETYPE FFmpegfs_Format::m_filetype
protected

File type, MP3, MP4, OPUS etc.

Definition at line 509 of file ffmpeg_utils.h.

Referenced by filetype(), init(), is_frameset(), and is_hls().

◆ m_options_map

const FFmpegfs_Format::OPTIONS_MAP FFmpegfs_Format::m_options_map
staticprotected

Map of options. One entry per supported destination type.

Definition at line 507 of file ffmpeg_utils.h.

Referenced by init().


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