<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[how to get media file information.]]></title><description><![CDATA[<p dir="auto">i want to get properties of video and audio file.<br />
like what is the frame rate , bit rate ,format ,all the bits and pices .<br />
how can i get this information??</p>
]]></description><link>https://forum.qt.io/topic/90458/how-to-get-media-file-information</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Jul 2026 22:03:41 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/90458.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 05 May 2018 05:19:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to how to get media file information. on Mon, 13 Aug 2018 04:07:09 GMT]]></title><description><![CDATA[<p dir="auto">after long works i made an app with mediainfo as backend.<br />
here is the app  <a href="https://github.com/rahmanshaber/CoreInfo" target="_blank" rel="noopener noreferrer nofollow ugc">CoreInfo</a>.<br />
thanks.</p>
]]></description><link>https://forum.qt.io/post/475708</link><guid isPermaLink="true">https://forum.qt.io/post/475708</guid><dc:creator><![CDATA[saber]]></dc:creator><pubDate>Mon, 13 Aug 2018 04:07:09 GMT</pubDate></item><item><title><![CDATA[Reply to how to get media file information. on Mon, 14 May 2018 14:00:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/saber">@<bdi>saber</bdi></a> said in <a href="/post/458101">how to get media file information.</a>:</p>
<blockquote>
<p dir="auto">can you show me the lib folder?<br />
and how to include it in .pro .<br />
an example will be great!!</p>
</blockquote>
<p dir="auto">As I wrote. Study the example. You said <code>MediaInfo</code> builds correctly on your system, so you have access to all the info you need, since it builds perfectly in Qt Creator. Don't expect everything to be done for you...<br />
Good luck!</p>
]]></description><link>https://forum.qt.io/post/458103</link><guid isPermaLink="true">https://forum.qt.io/post/458103</guid><dc:creator><![CDATA[Diracsbracket]]></dc:creator><pubDate>Mon, 14 May 2018 14:00:14 GMT</pubDate></item><item><title><![CDATA[Reply to how to get media file information. on Mon, 14 May 2018 13:57:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/diracsbracket">@<bdi>Diracsbracket</bdi></a></p>
<p dir="auto">oh!ok.<br />
can you show me the lib folder?<br />
and how to include it in .pro .<br />
an example will be great!!</p>
]]></description><link>https://forum.qt.io/post/458101</link><guid isPermaLink="true">https://forum.qt.io/post/458101</guid><dc:creator><![CDATA[saber]]></dc:creator><pubDate>Mon, 14 May 2018 13:57:11 GMT</pubDate></item><item><title><![CDATA[Reply to how to get media file information. on Mon, 14 May 2018 13:55:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/saber">@<bdi>saber</bdi></a> said in <a href="/post/458051">how to get media file information.</a>:</p>
<blockquote>
<p dir="auto">i want it as a lib</p>
</blockquote>
<p dir="auto"><code>MediaInfoLib</code> IS the lib. I thought this would have been clear enough...<br />
<code>MediaInfo</code> is just an application using it. Study that example to learn how to use it.</p>
]]></description><link>https://forum.qt.io/post/458098</link><guid isPermaLink="true">https://forum.qt.io/post/458098</guid><dc:creator><![CDATA[Diracsbracket]]></dc:creator><pubDate>Mon, 14 May 2018 13:55:10 GMT</pubDate></item><item><title><![CDATA[Reply to how to get media file information. on Mon, 14 May 2018 09:59:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/diracsbracket">@<bdi>Diracsbracket</bdi></a><br />
Thanks, mediainfo builds fine in my linux system.<br />
i want it as a lib(exclude all the gui and extra pieces) so it will be easer to include it in my project.<br />
i wanted to make a function that will take the file path &gt;&gt; send it to that lib &gt;&gt;lib will give the all the mediainfo.<br />
but i have no idea or programming skills to do that .so if you want the same ,please modify the mideainfo to a library.<br />
thanks</p>
]]></description><link>https://forum.qt.io/post/458051</link><guid isPermaLink="true">https://forum.qt.io/post/458051</guid><dc:creator><![CDATA[saber]]></dc:creator><pubDate>Mon, 14 May 2018 09:59:30 GMT</pubDate></item><item><title><![CDATA[Reply to how to get media file information. on Sun, 13 May 2018 10:39:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/saber">@<bdi>saber</bdi></a> said in <a href="/post/457858">how to get media file information.</a>:</p>
<blockquote>
<p dir="auto">can you help?</p>
</blockquote>
<p dir="auto">As <a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> suggested, I'm affraid that you will have to ask the authors of that library, as I haven't tried that one yet :-(.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/saber">@<bdi>saber</bdi></a> said in <a href="/post/457858">how to get media file information.</a>:</p>
<blockquote>
<p dir="auto">just giving me this "QVariant(Invalid)"</p>
</blockquote>
<p dir="auto">Since <code>QMediaMetaData::Duration</code> is a <code>qint64</code> as per <a href="http://doc.qt.io/qt-5/qmediametadata.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-5/qmediametadata.html</a>, maybe try as follows:</p>
<p dir="auto"><code>QString::number(m_player-&gt;metaData(QMediaMetaData::Duration))</code></p>
]]></description><link>https://forum.qt.io/post/457926</link><guid isPermaLink="true">https://forum.qt.io/post/457926</guid><dc:creator><![CDATA[Diracsbracket]]></dc:creator><pubDate>Sun, 13 May 2018 10:39:26 GMT</pubDate></item><item><title><![CDATA[Reply to how to get media file information. on Sat, 12 May 2018 20:00:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/saber">@<bdi>saber</bdi></a>, that's a question you should ask to the <code>mediainfo</code> authors. At least you should explain exactly what is happening to you.</p>
]]></description><link>https://forum.qt.io/post/457874</link><guid isPermaLink="true">https://forum.qt.io/post/457874</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sat, 12 May 2018 20:00:25 GMT</pubDate></item><item><title><![CDATA[Reply to how to get media file information. on Sat, 12 May 2018 16:33:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/diracsbracket">@<bdi>Diracsbracket</bdi></a><br />
hi .<br />
i found a library called mediainfo .here is the  <a href="https://github.com/MediaArea/MediaInfo" target="_blank" rel="noopener noreferrer nofollow ugc">github</a><br />
it has a example made by qt.<br />
but i don't understand how to build it or use it as a lib.<br />
can you help?</p>
<p dir="auto">and i tried this but not getting the duration.</p>
<pre><code>m_player-&gt;metaData(QMediaMetaData::Duration).toString();
</code></pre>
<p dir="auto">just giving me this "QVariant(Invalid)"</p>
]]></description><link>https://forum.qt.io/post/457858</link><guid isPermaLink="true">https://forum.qt.io/post/457858</guid><dc:creator><![CDATA[saber]]></dc:creator><pubDate>Sat, 12 May 2018 16:33:21 GMT</pubDate></item><item><title><![CDATA[Reply to how to get media file information. on Sat, 05 May 2018 08:08:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/saber">@<bdi>saber</bdi></a> said in <a href="/post/456488">how to get media file information.</a>:</p>
<blockquote>
<p dir="auto">this way can i get image info</p>
</blockquote>
<p dir="auto">It doesn't seem to work for images (as tested from the minimal example I posted above...)</p>
<p dir="auto">But, from searching on this forum (or on Google), the answer for pictures is given here:<br />
<a href="https://forum.qt.io/topic/83259/get-metadata-date-taken-location-from-photo-jpeg/2">https://forum.qt.io/topic/83259/get-metadata-date-taken-location-from-photo-jpeg/2</a><br />
<a href="https://github.com/mayanklahiri/easyexif" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/mayanklahiri/easyexif</a></p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/saber">@<bdi>saber</bdi></a> said in <a href="/post/456488">how to get media file information.</a>:</p>
<blockquote>
<p dir="auto">please give me some suggestion</p>
</blockquote>
<p dir="auto">Have a look at:<br />
<a href="http://en.cppreference.com/w/cpp/links/libs" target="_blank" rel="noopener noreferrer nofollow ugc">http://en.cppreference.com/w/cpp/links/libs</a></p>
]]></description><link>https://forum.qt.io/post/456491</link><guid isPermaLink="true">https://forum.qt.io/post/456491</guid><dc:creator><![CDATA[Diracsbracket]]></dc:creator><pubDate>Sat, 05 May 2018 08:08:38 GMT</pubDate></item><item><title><![CDATA[Reply to how to get media file information. on Sat, 05 May 2018 07:50:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/diracsbracket">@<bdi>Diracsbracket</bdi></a> thanks.</p>
<p dir="auto">this way can i get image info??<br />
if yes , how to get that?</p>
<pre><code>some of the specialized libraries out there.
</code></pre>
<p dir="auto">please give me some suggestion.</p>
]]></description><link>https://forum.qt.io/post/456488</link><guid isPermaLink="true">https://forum.qt.io/post/456488</guid><dc:creator><![CDATA[saber]]></dc:creator><pubDate>Sat, 05 May 2018 07:50:01 GMT</pubDate></item><item><title><![CDATA[Reply to how to get media file information. on Sat, 05 May 2018 07:48:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/saber">@<bdi>saber</bdi></a> said in <a href="/post/456484">how to get media file information.</a>:</p>
<blockquote>
<p dir="auto">Resolution,PixelAspectRatio</p>
</blockquote>
<p dir="auto">Probably because this info is not available in the AVI header (maybe not part of the AVI specs?).</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/saber">@<bdi>saber</bdi></a> said in <a href="/post/456484">how to get media file information.</a>:</p>
<blockquote>
<p dir="auto">and we ONLY get the metadata what is Available</p>
</blockquote>
<p dir="auto">You could probably use the <code>metaData()</code> method to query by key all the possible/relevant<br />
keys defined in the <code>QMediaMetaData</code> namespace, and check if it returns something valid?</p>
<pre><code>QVariant metaData(const QString &amp;key) const;
</code></pre>
<p dir="auto">Also keep in mind that Qt's Multimedia framework is not as complete as some of the specialized libraries out there.</p>
]]></description><link>https://forum.qt.io/post/456487</link><guid isPermaLink="true">https://forum.qt.io/post/456487</guid><dc:creator><![CDATA[Diracsbracket]]></dc:creator><pubDate>Sat, 05 May 2018 07:48:11 GMT</pubDate></item><item><title><![CDATA[Reply to how to get media file information. on Sat, 05 May 2018 07:19:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/diracsbracket">@<bdi>Diracsbracket</bdi></a><br />
thank you very much.</p>
<p dir="auto">some questions<br />
why we not getting Resolution,PixelAspectRatio ??</p>
<p dir="auto">and we ONLY get the metadata what is Available??</p>
]]></description><link>https://forum.qt.io/post/456484</link><guid isPermaLink="true">https://forum.qt.io/post/456484</guid><dc:creator><![CDATA[saber]]></dc:creator><pubDate>Sat, 05 May 2018 07:19:58 GMT</pubDate></item><item><title><![CDATA[Reply to how to get media file information. on Sat, 05 May 2018 07:03:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/saber">@<bdi>saber</bdi></a> said in <a href="/post/456478">how to get media file information.</a>:</p>
<blockquote>
<p dir="auto">but don't know how to use that</p>
</blockquote>
<p dir="auto">This is a minimal example you can try out:<br />
(based on: <a href="http://qt.shoutwiki.com/wiki/Using_Qt_Mobility_to_get_metadata_from_media_files" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt.shoutwiki.com/wiki/Using_Qt_Mobility_to_get_metadata_from_media_files</a>)</p>
<ol>
<li>Define player as a class member:</li>
</ol>
<pre><code>private:
    QMediaPlayer *m_player;
</code></pre>
<ol start="2">
<li>In your code:</li>
</ol>
<pre><code>   m_player = new QMediaPlayer(this);
  connect(m_player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(onMediaStatusChanged(QMediaPlayer::MediaStatus)));

   m_player-&gt;setMedia(QUrl::fromLocalFile("C:\\yourMovie.avi"));
</code></pre>
<ol start="3">
<li>Define the <code>onMediaStatusChanged</code> slot e.g. as follows:</li>
</ol>
<pre><code>void MainWindow::onMediaStatusChanged(QMediaPlayer::MediaStatus status)
{
    if (status == QMediaPlayer::LoadedMedia)
        GetMetaData(m_player);
}
</code></pre>
<ol start="4">
<li>The <code>GetMetaData()</code> method lists all available metadata:</li>
</ol>
<pre><code>void MainWindow::GetMetaData(QMediaPlayer *player)
{
   // Get the list of keys there is metadata available for
   QStringList metadatalist = player-&gt;availableMetaData();

   // Get the size of the list
   int list_size = metadatalist.size();

   //qDebug() &lt;&lt; player-&gt;isMetaDataAvailable() &lt;&lt; list_size;

   // Define variables to store metadata key and value
   QString metadata_key;
   QVariant var_data;

   for (int indx = 0; indx &lt; list_size; indx++)
   {
     // Get the key from the list
     metadata_key = metadatalist.at(indx);

     // Get the value for the key
     var_data = player-&gt;metaData(metadata_key);

    qDebug() &lt;&lt; metadata_key &lt;&lt; var_data.toString();
   }
 }
</code></pre>
<p dir="auto">The output on a sample .avi movie on my system is:</p>
<pre><code>"AudioBitRate" "128000"
"AudioCodec" "MPEG Audio Layer-3 (MP3)"
"ChannelCount" "2"
"Copyright" "SaM"
"Duration" "5069876"
"PixelAspectRatio" ""
"Resolution" ""
"SampleRate" "48000"
"VideoBitRate" "1028056"
"VideoCodec" "MPEG-4 part 2 Video (MP4V)"
"VideoFrameRate" "24"
</code></pre>
]]></description><link>https://forum.qt.io/post/456483</link><guid isPermaLink="true">https://forum.qt.io/post/456483</guid><dc:creator><![CDATA[Diracsbracket]]></dc:creator><pubDate>Sat, 05 May 2018 07:03:26 GMT</pubDate></item><item><title><![CDATA[Reply to how to get media file information. on Sat, 05 May 2018 06:06:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/diracsbracket">@<bdi>Diracsbracket</bdi></a><br />
yes .<br />
but don't know how to use that .</p>
]]></description><link>https://forum.qt.io/post/456478</link><guid isPermaLink="true">https://forum.qt.io/post/456478</guid><dc:creator><![CDATA[saber]]></dc:creator><pubDate>Sat, 05 May 2018 06:06:41 GMT</pubDate></item><item><title><![CDATA[Reply to how to get media file information. on Sat, 05 May 2018 05:34:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/saber">@<bdi>saber</bdi></a><br />
Hi,<br />
Did you have a look at the following example?<br />
<a href="https://doc.qt.io/qt-5.10/qtmultimedia-multimediawidgets-player-player-cpp.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5.10/qtmultimedia-multimediawidgets-player-player-cpp.html</a></p>
<p dir="auto">It uses the <code>QMediaMetaData</code> namespace:<br />
<a href="http://doc.qt.io/qt-5/qmediametadata.html#details" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-5/qmediametadata.html#details</a></p>
]]></description><link>https://forum.qt.io/post/456472</link><guid isPermaLink="true">https://forum.qt.io/post/456472</guid><dc:creator><![CDATA[Diracsbracket]]></dc:creator><pubDate>Sat, 05 May 2018 05:34:16 GMT</pubDate></item></channel></rss>