Library for obtaining duration of video movies in various formats?
-
I am writing a fairly simple editor for managing video subtitle information(*). I do not touch the video itself, but use an external player (such as MPC-HC) to video in any of umpteen different formats. It would be very nice if my editor could obtain the playing time for the video file, to bracket the timing of the subtitles. Some video editors write that into the NTFS attributes, but only sometimes, and only for some formats. I guess some formats provide it in metadata within the file, but again: only for some formats. And I do not want to spend weeks chasing duration info in this format, that format, and the third format... Do you know of any library that can extract metadata info of this sort from "all" different video file formats? It certainly would not hurt if I could also extract e.g. fps value, video resolution etc. I would need either source code or something that can be called from dotNet/C# - I am prepared to translate from e.g. plain C to C#. Obviously, I can pick up the source code for MPC-HC and extract that 0.1% of it that I need, but I am hoping for something requiring less work, less need to understand the structure of half a million code lines (or however large MPC source code is). (*) regarding my desire to reinvent the subtitle editor wheel: I never found any editor suitable for handling multiple subtitle formats, and multiple languages, with the capability to generate a "concrete" subtitle file for lines spoken in specific language, subtitles in a specific languate. Also, I never saw good mechanisms for creating timestamped subtitles from scratch in an efficient manner.
-
I am writing a fairly simple editor for managing video subtitle information(*). I do not touch the video itself, but use an external player (such as MPC-HC) to video in any of umpteen different formats. It would be very nice if my editor could obtain the playing time for the video file, to bracket the timing of the subtitles. Some video editors write that into the NTFS attributes, but only sometimes, and only for some formats. I guess some formats provide it in metadata within the file, but again: only for some formats. And I do not want to spend weeks chasing duration info in this format, that format, and the third format... Do you know of any library that can extract metadata info of this sort from "all" different video file formats? It certainly would not hurt if I could also extract e.g. fps value, video resolution etc. I would need either source code or something that can be called from dotNet/C# - I am prepared to translate from e.g. plain C to C#. Obviously, I can pick up the source code for MPC-HC and extract that 0.1% of it that I need, but I am hoping for something requiring less work, less need to understand the structure of half a million code lines (or however large MPC source code is). (*) regarding my desire to reinvent the subtitle editor wheel: I never found any editor suitable for handling multiple subtitle formats, and multiple languages, with the capability to generate a "concrete" subtitle file for lines spoken in specific language, subtitles in a specific languate. Also, I never saw good mechanisms for creating timestamped subtitles from scratch in an efficient manner.
MediaInfo is a opensource library that extracts information from most media files, there is a DLL and an an exe, you cold look at the exe source to see how to interact with the DLL.
-
MediaInfo is a opensource library that extracts information from most media files, there is a DLL and an an exe, you cold look at the exe source to see how to interact with the DLL.