Skip to content

A C# library for parsing .MOI files that have been generated by JVC camcorders.

License

Notifications You must be signed in to change notification settings

seanclifford/MOIParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MOIParser

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.

Windows .NET Core

What's an MOI file?

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.

Parsed Values

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

Usage

//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());

Other included projects

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.

About

A C# library for parsing .MOI files that have been generated by JVC camcorders.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages