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?
Asked
Active
Viewed 987 times
1

adamm
- 849
- 1
- 6
- 17
1 Answers
2
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

Bakudan
- 19,134
- 9
- 53
- 73

Jérôme Martinez
- 1,118
- 5
- 10
-
Thank you for your answer. I use `MediaInfoNET.dll`. The problem is value of `General->DurationMillis`, which should return duration in milliseconds. But when the duration is more then one hour, it always return a value that is divisible by `1000*3600*60`, and that's why I don't have information about seconds. I don't know why is this happening, because in a case of a file with duration less then one hour, everything is OK. – adamm Apr 04 '15 at 08:56
-
Looks like it is a bug in MediaInfoNET.dll. Either report to the developer of this intermediate layer or use directly official VB or C# binding (available [here](http://mediaarea.net/download/binary/libmediainfo0/0.7.72/MediaInfo_DLL_0.7.72_Windows_i386_WithoutInstaller.7z) for example) – Jérôme Martinez Apr 04 '15 at 10:51