May 24, 2010

Trying to Bring WebM Support into Moonlight

First step: porting Matroska's JEBML (a Java parser for EBML) to C#. EBML is the "binary xml" format that is the basis for the Matroska (thus WebM) container.

I tried to convert libebml2 (written in C) to C#, but it is too "unobjectifiable" and so I searched a bit more for some easier path. Didn't look at some of the C++ parsers available, but JEBML although looking a bit abandoned of late seems to model the main concepts and surely is a good starting point. JEBML is LGPL-licensed which should not compromise the whole effort.

Going with renaming .java files to .cs, and doing wholesale Find&Replace, but have to stop now, while it doesn't even compile yet. Tomorrow I hope to fix it into a somewhat compilable state, and then, I'll need to move to .NET system classes, and use generics to slim down the whole thing.

The sources so far were uploaded into my Managed.Commons group, later I'll decide if add a project on Google Code, or GitHub.

http://groups.google.com/group/managedcommons/web/Managed.Ebml.rar

3 comments:

Rodrigo B. de Oliveira said...

Have you considered sharpen[1] for the java to c# translation part of the job?

[1] http://developer.db4o.com/Blogs/Product/tabid/167/entryid/95/Default.aspx

slyi said...

Are basing the code on Jcodec? http://code.google.com/p/jcodec/source/detail?r=37

Panda82 said...

Hi! I have been looking for a way to parse matroska files using C# with out using a dll. Thanks for posting your JEBML port! I have made alot of progress finishing off the conversion from java. It now compiles and reads the EBML headers, but thats all it reads so far. I would be happy to send you the code and hope you can provide some answers to the remaining problems? I did'nt know anything about java untill i started working on this. Thanks