visual-c++mediainfo

Mediainfo.dll duration parameter doesn't return seconds


I am working on a Visual C++ project, and I need to get duration of movie from a chosen file. I use Mediainfo.dll to retrieve this information (movieFile->General->DurationString;). The problem is when duration is more then one hour, I don't get seconds, i.e. seconds are always displayed as 00. When duration is less then one hour, everything is fine. I had also tried with movieFile->General->DurationMillis;, which returns duration in miliseconds, but I also get 00 seconds. Does anyone knows what might be the problem?


Solution

  • I don't know which intermediate layer you use, but from MediaInfo, MediaInfo::Get(Stream_General, 0, "Duration") returns a value in milliseconds for sure. MediaInfo::Get(Stream_General, 0, "Duration/String3") will return duration in "HH:MM:SS.mmm" format.

    Jérôme, developer of MediaInfo