Unsolved Why is the metadata of a video file not displayed?
-
I need to get the metadata from the video file:
QMediaMetaData::GPSLatitude,QMediaMetaData::GPSLongitude and QMediaMetaData::DateTimeOriginal.
I do it this way:
QMediaPlayer *player = new QMediaPlayer(this); player->setMedia(QUrl::fromLocalFile(model->index(i,1).data().toString())); QString GPSLatitudeVideo = ""; QString GPSLongitudeVideo = ""; QString DateTimeOriginalVideo = ""; qDebug()<<model->index(i,1).data().toString()<<"+++"; //if (player->isMetaDataAvailable()) //{ /* YOUR CODE HERE SUCH AS*/ GPSLatitudeVideo = player->metaData(QMediaMetaData::GPSLatitude).toString(); GPSLongitudeVideo = player->metaData(QMediaMetaData::GPSLongitude).toString(); DateTimeOriginalVideo = player->metaData(QMediaMetaData::DateTimeOriginal).toString(); qDebug()<<"+++"<<GPSLatitudeVideo<<GPSLongitudeVideo<<DateTimeOriginalVideo; //}
But metadata is not displayed:
"I://Сб_апр_21_2018_21_45_56/sshow_2018-02-28_211514.avi" +++ +++ "" "" ""
What am I doing wrong ?
-
@haifisch are you sure that your video really has such metadata inside it?
Have you tried displaying the metadata you're interested in with some other tool, i.e. ffmpeg? something like this:
ffmpeg -i my_video.avi -hide_banner
In addition, your code snippet has Qt's check for metadata available disabled, why is that?
-
@Pablo-J.-Rogina QMediaMetaData::DateTimeOriginal These metadata, at least there are.
In addition, your code snippet has Qt's check for metadata available disabled, why is that?
I took this example here.
-
@Pablo-J.-Rogina said in Why is the metadata of a video file not displayed?:
ffmpeg
How to ffmpeg into my application?
-
@haifisch You run ffmpeg on the command line...
-
@Pablo-J.-Rogina ![Meta data]( image url)
-