Description of a stream (video, audio, subtitle) in a multimedia file. More...
Public Types | |
enum | StreamType { Video, Audio, Subtitle, Other } |
Type of stream in a multimedia file. More... | |
enum | SubtitleType { SubRip, SubSsa, SubAss, SubDvd, SubDvb, SubTeletext, SubCc, SubOther, SubNone } |
Type of encoding for subtitles. More... | |
Public Member Functions | |
QtlMediaStreamInfo () | |
Default constructor. More... | |
int | audioChannels () const |
Get the number of audio channels. More... | |
int | bitRate () const |
Get the bitrate of the stream. More... | |
int | ccNumber () const |
Get the Close Captions number (CC subtitles only). More... | |
QString | codecName () const |
Get the codec name of the stream. More... | |
QString | description (bool compact) const |
Get a human readable description of the stream. More... | |
float | displayAspectRatio (bool original=false) const |
Get the video frame display aspect ratio. More... | |
QString | displayAspectRatioString (bool original=false, bool validFloat=false) const |
Get the video frame display aspect ratio as a string. More... | |
int | ffIndex () const |
Get the stream index as allocated by FFmpeg/FFprobe. More... | |
QString | ffSpecifier (int fileIndex=0) const |
Get the stream specifier for FFmpeg/FFprobe command line. More... | |
bool | forced () const |
Check if the stream is "forced" (mostly subtitles). More... | |
float | frameRate () const |
Get the frame rate of the stream (video). More... | |
int | height () const |
Get the video frame height in pixels (video and DVD subtitles). More... | |
bool | impaired () const |
Check if the stream is targeted to hearing or visual impaired audience (audio or subtitle). More... | |
bool | isCommentary () const |
Check if the stream is a commentary soundtrack. More... | |
bool | isDubbedAudio () const |
Check if the stream is a dubbed soundtrack. More... | |
bool | isOriginalAudio () const |
Check if the stream is an original soundtrack. More... | |
QString | language () const |
Get the stream language (audio, subtitle). More... | |
int | rotation () const |
Get the video frame rotation in degrees. More... | |
int | samplingRate () const |
Get the sampling rate. More... | |
void | setAudioChannels (int audioChannels) |
Set the number of audio channels. More... | |
void | setBitRate (int bitRate) |
Set the bitrate of the stream. More... | |
void | setCcNumber (int ccNumber) |
Set the Close Captions number (CC subtitles only). More... | |
void | setCodecName (const QString &codecName) |
Set the codec name of the stream. More... | |
void | setCommentary (bool commentary) |
Set if the stream is a commentary soundtrack. More... | |
void | setDisplayAspectRatio (float dar) |
Set the original video frame display aspect ratio. More... | |
void | setDubbedAudio (bool dubbedAudio) |
Set if the stream is a dubbed soundtrack. More... | |
void | setFFIndex (int ffIndex) |
Set the stream index as allocated by FFmpeg/FFprobe. More... | |
void | setForced (bool forced) |
Set if the stream is "forced" (mostly subtitles). More... | |
void | setForcedDisplayAspectRatio (float dar) |
Force the video frame display aspect ratio to a value not identical to the original one. More... | |
void | setFrameRate (float frameRate) |
Set the frame rate of the stream (video). More... | |
void | setHeight (int height) |
Set the video frame height in pixels (video and DVD subtitles). More... | |
void | setImpaired (bool impaired) |
Set if the stream is targeted to hearing or visual impaired audience (audio or subtitle). More... | |
void | setLanguage (const QString &language) |
Set the stream language (audio, subtitle). More... | |
void | setOriginalAudio (bool originalAudio) |
Set if the stream is an original soundtrack. More... | |
void | setRotation (int rotation) |
Set the video frame rotation in degrees. More... | |
void | setSamplingRate (int samplingRate) |
Set the sampling rate. More... | |
void | setStreamId (int id) |
Set the physical stream id in the input file. More... | |
void | setStreamType (const StreamType &streamType) |
Set the stream type. More... | |
void | setSubtitleType (const SubtitleType &subtitleType) |
Set the subtitle type of the stream. More... | |
void | setTeletextPage (int teletextPage) |
Set the Teletext page number (Teletext subtitles only). More... | |
void | setTitle (const QString &title) |
Set the free format description of the stream. More... | |
void | setWidth (int width) |
Set the video frame width in pixels (video and DVD subtitles). More... | |
int | streamId () const |
Get the physical stream id in the input file. More... | |
StreamType | streamType () const |
Get the stream type. More... | |
QString | streamTypeName () const |
Get the stream type as a string. More... | |
SubtitleType | subtitleType () const |
Get the subtitle type of the stream. More... | |
int | teletextPage () const |
Get the Teletext page number (Teletext subtitles only). More... | |
QString | title () const |
Get the free format description of the stream. More... | |
int | width () const |
Get the video frame width in pixels (video and DVD subtitles). More... | |
Static Public Member Functions | |
static QString | fileExtension (SubtitleType type) |
Get the usual file extension for subtitle. More... | |
static bool | isTextFile (SubtitleType type) |
Check if subtitles files are text files. More... | |
static bool | isTextFile (const QString &fileName) |
Check if subtitles files are text files. More... | |
static void | merge (QtlMediaStreamInfoList &destination, const QtlMediaStreamInfoList &source) |
Merge two lists of stream informations. More... | |
static QString | streamTypeName (StreamType type) |
Convert a StreamType into a string. More... | |
static SubtitleType | subtitleType (const QString &fileName, bool checkExistence=false) |
Get the type of a subtitle file, based on its extension. More... | |
Static Private Member Functions | |
static void | add (QString &str, const QString &item, const QString &separator=", ") |
Append a separator to a string if it is non empty and a new item. More... | |
Private Attributes | |
int | _audioChannels |
Audio channel count. More... | |
int | _bitRate |
Bitrate (bits/second). More... | |
int | _ccNumber |
Closed Captions channel and field. More... | |
QString | _codecName |
Codec name (free format). More... | |
bool | _commentary |
Commentary soundtrack. More... | |
float | _dar |
Video frame display aspect ratio. More... | |
bool | _dubbedAudio |
Dubbed soundtrack. More... | |
int | _ffIndex |
Stream index as allocated by FFmpeg/FFprobe. More... | |
bool | _forced |
Forced stream. More... | |
float | _forcedDar |
Manually forced video frame display aspect ratio. More... | |
float | _frameRate |
Frame rate (frames/second). More... | |
int | _height |
Video frame height in pixels. More... | |
bool | _impaired |
For hearing/visual impaired. More... | |
QString | _language |
Stream language (audio, subtitle). More... | |
bool | _originalAudio |
Original soundtrack. More... | |
int | _rotation |
Video frame rotation in degrees. More... | |
int | _samplingRate |
Sampling rate (samples/second). More... | |
int | _streamId |
Physical stream id in input file. More... | |
StreamType | _streamType |
Stream type (audio, video, etc.) More... | |
SubtitleType | _subtitleType |
Subtitle type. More... | |
int | _teletextPage |
Teletext page number (Teletext subtitles only). More... | |
QString | _title |
Free format readable description. More... | |
int | _width |
Video frame width in pixels. More... | |
Description of a stream (video, audio, subtitle) in a multimedia file.
Type of encoding for subtitles.
QtlMediaStreamInfo::QtlMediaStreamInfo | ( | ) |
Default constructor.
|
static |
Convert a StreamType into a string.
[in] | type | Stream type. |
|
inline |
Get the stream type.
|
inline |
Get the stream type as a string.
|
inline |
Set the stream type.
[in] | streamType | The stream type. |
QString QtlMediaStreamInfo::description | ( | bool | compact | ) | const |
Get a human readable description of the stream.
[in] | compact | If true, return a more compact string, for short-width display. |
|
inline |
Get the free format description of the stream.
void QtlMediaStreamInfo::setTitle | ( | const QString & | title | ) |
Set the free format description of the stream.
[in] | title | The free format description of the stream. |
|
inline |
Get the codec name of the stream.
void QtlMediaStreamInfo::setCodecName | ( | const QString & | codecName | ) |
Set the codec name of the stream.
[in] | codecName | The codec name of the stream. |
|
inline |
Get the stream language (audio, subtitle).
void QtlMediaStreamInfo::setLanguage | ( | const QString & | language | ) |
Set the stream language (audio, subtitle).
[in] | language | The stream language. |
|
inline |
Get the stream index as allocated by FFmpeg/FFprobe.
QString QtlMediaStreamInfo::ffSpecifier | ( | int | fileIndex = 0 | ) | const |
Get the stream specifier for FFmpeg/FFprobe command line.
[in] | fileIndex | Optional file index. |
void QtlMediaStreamInfo::setFFIndex | ( | int | ffIndex | ) |
Set the stream index as allocated by FFmpeg/FFprobe.
[in] | ffIndex | The stream index as allocated by FFmpeg/FFprobe. |
|
inline |
Get the physical stream id in the input file.
Its semantic depends on the input file format. For MPEG-TS files, this is the PID. For MPEG-PS files, this is the stream id.
|
inline |
Set the physical stream id in the input file.
Do no filtering on the value since the semantic is unknown.
[in] | id | The stream id. |
|
inline |
Get the Teletext page number (Teletext subtitles only).
void QtlMediaStreamInfo::setTeletextPage | ( | int | teletextPage | ) |
Set the Teletext page number (Teletext subtitles only).
[in] | teletextPage | The Teletext page number. |
|
inline |
Get the Close Captions number (CC subtitles only).
The CC are numbered as follow:
void QtlMediaStreamInfo::setCcNumber | ( | int | ccNumber | ) |
Set the Close Captions number (CC subtitles only).
[in] | ccNumber | The Close Captions number. |
|
inline |
Get the video frame width in pixels (video and DVD subtitles).
void QtlMediaStreamInfo::setWidth | ( | int | width | ) |
Set the video frame width in pixels (video and DVD subtitles).
[in] | width | The video frame width. |
|
inline |
Get the video frame height in pixels (video and DVD subtitles).
void QtlMediaStreamInfo::setHeight | ( | int | height | ) |
Set the video frame height in pixels (video and DVD subtitles).
[in] | height | The video frame height in pixels. |
float QtlMediaStreamInfo::displayAspectRatio | ( | bool | original = false | ) | const |
Get the video frame display aspect ratio.
[in] | original | If true, ignore the forced DAR (if specified) and always return the original DAR from the input file. |
QString QtlMediaStreamInfo::displayAspectRatioString | ( | bool | original = false , |
bool | validFloat = false |
||
) | const |
Get the video frame display aspect ratio as a string.
[in] | original | If true, ignore the forced DAR (if specified) and always return the original DAR from the input file. |
[in] | validFloat | If true, always return a string which can be interpreted as a float using qtlToFloat(). |
void QtlMediaStreamInfo::setDisplayAspectRatio | ( | float | dar | ) |
Set the original video frame display aspect ratio.
[in] | dar | The video frame display aspect ratio. |
void QtlMediaStreamInfo::setForcedDisplayAspectRatio | ( | float | dar | ) |
Force the video frame display aspect ratio to a value not identical to the original one.
[in] | dar | The forced video frame display aspect ratio. If zero, there is no more forced DAR and the original DAR from the input file is used. |
|
inline |
Get the video frame rotation in degrees.
void QtlMediaStreamInfo::setRotation | ( | int | rotation | ) |
Set the video frame rotation in degrees.
[in] | rotation | The video frame rotation in degrees. |
|
inline |
Check if the stream is "forced" (mostly subtitles).
Forced subtitles for a given language shall be displayed when the selected audio stream has the same language. They typically correspond to fragment of dialogs which are in a different language.
|
inline |
Set if the stream is "forced" (mostly subtitles).
[in] | forced | True if the stream is "forced". |
|
inline |
Check if the stream is targeted to hearing or visual impaired audience (audio or subtitle).
|
inline |
Set if the stream is targeted to hearing or visual impaired audience (audio or subtitle).
[in] | impaired | True if the stream is targeted to hearing or visual impaired audience. |
|
inline |
Get the bitrate of the stream.
void QtlMediaStreamInfo::setBitRate | ( | int | bitRate | ) |
Set the bitrate of the stream.
[in] | bitRate | The bitrate of the stream in bits/second. |
|
inline |
Get the frame rate of the stream (video).
void QtlMediaStreamInfo::setFrameRate | ( | float | frameRate | ) |
Set the frame rate of the stream (video).
[in] | frameRate | The frame rate of the stream in frames/second or zero if unknown. |
|
inline |
Check if the stream is an original soundtrack.
|
inline |
Set if the stream is an original soundtrack.
[in] | originalAudio | True if the stream is an original soundtrack. |
|
inline |
Check if the stream is a dubbed soundtrack.
|
inline |
Set if the stream is a dubbed soundtrack.
[in] | dubbedAudio | True if the stream is a dubbed soundtrack. |
|
inline |
Get the number of audio channels.
void QtlMediaStreamInfo::setAudioChannels | ( | int | audioChannels | ) |
Set the number of audio channels.
[in] | audioChannels | The number of audio channels. |
|
inline |
Get the sampling rate.
void QtlMediaStreamInfo::setSamplingRate | ( | int | samplingRate | ) |
Set the sampling rate.
[in] | samplingRate | The sampling rate in samples/seconds. |
|
inline |
Check if the stream is a commentary soundtrack.
|
inline |
Set if the stream is a commentary soundtrack.
[in] | commentary | True if the stream is a commentary soundtrack. |
|
inline |
Get the subtitle type of the stream.
|
inline |
Set the subtitle type of the stream.
[in] | subtitleType | The subtitle type of the stream. |
|
static |
Get the type of a subtitle file, based on its extension.
[in] | fileName | File name. The file name extension is used to determine the subtitle type. |
[in] | checkExistence | If true, also check that the file exists. If false, only check the file name extension. |
|
static |
Get the usual file extension for subtitle.
[in] | type | Subtitle type. |
|
static |
Check if subtitles files are text files.
[in] | type | Subtitle type to check. |
|
inlinestatic |
Check if subtitles files are text files.
[in] | fileName | Subtitle file name. The file name extension is used to determine the subtitle type. |
|
static |
Merge two lists of stream informations.
[in,out] | destination | All existing streams in this list are merged with their counterpart in source. For each stream in destination, if a stream with the same streamId() exists in source, the missing information are added in the stream in destination. |
[in] | source | A list of stream information. |
|
staticprivate |
Append a separator to a string if it is non empty and a new item.
[in,out] | str | String to update. |
[in] | item | Item to add. |
[in] | separator | Separator to append if str is not empty. |
|
private |
Stream type (audio, video, etc.)
|
private |
Free format readable description.
|
private |
Codec name (free format).
|
private |
Stream language (audio, subtitle).
|
private |
Stream index as allocated by FFmpeg/FFprobe.
|
private |
Physical stream id in input file.
|
private |
Subtitle type.
|
private |
Teletext page number (Teletext subtitles only).
|
private |
Closed Captions channel and field.
|
private |
Video frame width in pixels.
|
private |
Video frame height in pixels.
|
private |
Video frame display aspect ratio.
|
private |
Manually forced video frame display aspect ratio.
|
private |
Video frame rotation in degrees.
|
private |
Forced stream.
|
private |
For hearing/visual impaired.
|
private |
Bitrate (bits/second).
|
private |
Frame rate (frames/second).
|
private |
Original soundtrack.
|
private |
Dubbed soundtrack.
|
private |
Audio channel count.
|
private |
Sampling rate (samples/second).
|
private |
Commentary soundtrack.