MythTV  master
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
VideoMetaData Class Reference

Reads video metadata tags using FFmpeg Raw values for Orientation & Date are read quickly via FFmpeg API. More...

Inheritance diagram for VideoMetaData:
Inheritance graph
[legend]
Collaboration diagram for VideoMetaData:
Collaboration graph
[legend]

Public Member Functions

 VideoMetaData (const QString &filePath)
 Constructor. Opens best video stream from video. More...
 
 ~VideoMetaData () override
 Destructor. Closes file. More...
 
bool IsValid () override
 
QStringList GetAllTags () override
 Reads relevant video metadata by running mythffprobe. More...
 
int GetOrientation (bool *exists=nullptr) override
 Read FFmpeg video orientation tag. More...
 
QDateTime GetOriginalDateTime (bool *exists=nullptr) override
 Read video datestamp. More...
 
QString GetComment (bool *exists=nullptr) override
 Read Video comment from metadata. More...
 

Protected Member Functions

QString GetTag (const QString &key, bool *exists=nullptr)
 Read a single video tag. More...
 

Protected Attributes

AVFormatContext * m_context { nullptr }
 
AVDictionary * m_dict { nullptr }
 FFmpeg tag dictionary. More...
 

Additional Inherited Members

Detailed Description

Reads video metadata tags using FFmpeg Raw values for Orientation & Date are read quickly via FFmpeg API.

However, as collating and interpreting other tags is messy and dependant on internal FFmpeg changes, informational data is derived via mythffprobe (a slow operation)

Definition at line 482 of file imagemetadata.cpp.

Constructor & Destructor Documentation

◆ VideoMetaData()

VideoMetaData::VideoMetaData ( const QString &  filePath)
explicit

Constructor. Opens best video stream from video.

Parameters
filePathAbsolute video path

Definition at line 508 of file imagemetadata.cpp.

◆ ~VideoMetaData()

VideoMetaData::~VideoMetaData ( )
override

Destructor. Closes file.

Definition at line 531 of file imagemetadata.cpp.

Member Function Documentation

◆ IsValid()

bool VideoMetaData::IsValid ( )
inlineoverridevirtual

Implements ImageMetaData.

Definition at line 488 of file imagemetadata.cpp.

Referenced by GetAllTags(), VideoMetaData(), and ~VideoMetaData().

◆ GetAllTags()

QStringList VideoMetaData::GetAllTags ( )
overridevirtual

Reads relevant video metadata by running mythffprobe.

Warning
Blocks for up to 5 secs

As video tags are unstructured they are massaged into groups of format, stream0, streamN to segregate them and permit reasonable display ordering. The stream indices reflect the stream order returned by mythffprobe and do not necessarily correlate with FFmpeg streams

Returns
List of encoded video metadata tags
See also
ImageMetaData::FromString()

Implements ImageMetaData.

Definition at line 548 of file imagemetadata.cpp.

◆ GetOrientation()

int VideoMetaData::GetOrientation ( bool exists = nullptr)
overridevirtual

Read FFmpeg video orientation tag.

Parameters
[out]exists(Optional) True if orientation is defined by metadata
Returns
Exif orientation code

Implements ImageMetaData.

Definition at line 658 of file imagemetadata.cpp.

◆ GetOriginalDateTime()

QDateTime VideoMetaData::GetOriginalDateTime ( bool exists = nullptr)
overridevirtual

Read video datestamp.

Parameters
[out]exists(Optional) True if datestamp is defined by metadata
Returns
Timestamp (possibly invalid) in camera timezone

Implements ImageMetaData.

Definition at line 670 of file imagemetadata.cpp.

◆ GetComment()

QString VideoMetaData::GetComment ( bool exists = nullptr)
overridevirtual

Read Video comment from metadata.

Always empty

Parameters
[out]exists(Optional) Always false
Returns
Empty comment

Implements ImageMetaData.

Definition at line 685 of file imagemetadata.cpp.

◆ GetTag()

QString VideoMetaData::GetTag ( const QString &  key,
bool exists = nullptr 
)
protected

Read a single video tag.

Parameters
[in]keyFFmpeg tag name
[out]exists(Optional) True if tag exists in metadata
Returns
Tag value as a string

Definition at line 632 of file imagemetadata.cpp.

Referenced by GetOrientation(), and GetOriginalDateTime().

Member Data Documentation

◆ m_context

AVFormatContext* VideoMetaData::m_context { nullptr }
protected

Definition at line 498 of file imagemetadata.cpp.

Referenced by VideoMetaData(), and ~VideoMetaData().

◆ m_dict

AVDictionary* VideoMetaData::m_dict { nullptr }
protected

FFmpeg tag dictionary.

Definition at line 500 of file imagemetadata.cpp.

Referenced by GetTag(), IsValid(), and VideoMetaData().


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