MOIParser is a C# library for parsing .MOI files that have been generated by JVC camcorders.
MOIParser is Copyright 2011 Sean Clifford. MOIParser is licensed under the GNU Public Licence. See COPYING.txt for details.
MOI files are binary metadata files that are created alongside MPEG2 .MOD or .TOD files to store information such as creation date, aspect ratio, and length of recording.
MOIParser was written as I could not find any existing software to read .MOI files.
These are the values that MOIParser can retreive from a .MOI file. A specification of the full set of available data can be found at Wikipedia.
- Version
- File Size
- Creation Date
- Video Length
- Aspect Ratio
- TV System
//To parse from a file or folder:
string filePath = "<Put File or Folder Path Here>";
MOIPathParser moiParser = new MOIPathParser(filePath);
moiParser.Parse();
foreach (MOIFile moiFile in moiParser.ParsedMOIFiles)
Console.WriteLine("File Name: {0}, Date: {1}, Length: {2}", moiFile.FileName, moiFile.CreationDate, moiFile.VideoLength);
foreach (MOIParserError error in moiParser.ParseErrors)
Console.WriteLine("Error parsing {0}. {1}", error.FilePath, error.ToString());
//To parse a single file from a byte array
byte[] moiData = new byte[0];
MOIFileParser moiFileParser = new MOIFileParser(moiData);
if (moiFileParser.MOIFile != null)
Console.WriteLine("File Name: {0}, Date: {1}, Length: {2}", moiFileParser.MOIFile.FileName, moiFileParser.MOIFile.CreationDate, moiFileParser.MOIFile.VideoLength);
if (moiFileParser.ParseError != null)
Console.WriteLine("Error parsing {0}. {1}", moiFileParser.ParseError.FilePath, moiFileParser.ParseError.ToString());
MOIFileReader is a simple UI written in C# WPF to demonstrate how to use the MOIParser library.
MOITests is a unit test library for MOIParser using the NUnit testing framework.