Is there a .NET library for working with ASF files that doesn't use COM/Interop? I know there is an official spec from Microsoft (http://go.microsoft.com/fwlink/?LinkId=31334).
Asked
Active
Viewed 2,506 times
1 Answers
6
Shameless plug here - I wrote a .NET ASF parser called AsfMojo that's out there on codeplex:
AsfMojo is an open source .NET ASF parsing library, providing support for parsing Windows Media Audio (WMA) and Windows Media Video (WMV) files. It offers classes to create streams from packet data within a media file, gather file statistics and extract audio segments or frame accurate still frames. The library parses ASF objects as per the ASF specification revision 01.20.05
Check it out and see if it works for you - the ASF parsing itself is pure .NET code (based on the ASF spec), just for creating still frames for particular time offsets Media SDK/InterOp is used under the hood.

BrokenGlass
- 158,293
- 28
- 286
- 335
-
Can it read a non-seekable stream, like a live video stream? I downloaded the code and tried plugging my URL into the WPF UI sample and it just clocked (my guess is it thought the live stream was a file that eventually would finish downloading...) If it can read a non-seekable stream, could you post a quick sample/point me in the right direction? – Peter Mar 06 '11 at 04:56
-
@Patricker: the WPF sample app is a UI specifically for ASF **files** (similiar to ASF Viewer). If you look at the library code itself you will see that the `AsfFile` class tries to completely parse whatever file you point it to, this includes the time offset of the first and last packet in the file - for streams unfortunately that means that it will stall and/or fail, it's not a supported scenario. You could take that part out, but you will need some code changes in the library itself - what are you trying to do? Maybe there's another way. – BrokenGlass Mar 06 '11 at 05:31
-
I'm trying to view/process a live video stream from an IP Camera. – Peter Mar 06 '11 at 05:48
-
@Patricker: AsfMojo is currently a file / packet oriented library, so unless you chunk up the file you can't use AsfMojo in its current form - that's not to say you couldn't use *parts* of it, i.e. the ASF packet parsing (see `AsfPacket` class) - it all depends on what you want to do with the live stream data. – BrokenGlass Mar 06 '11 at 20:17
-
I think AsfMojo will be a good place to start, I don't mind getting my hands dirty, I'll start with AsfPacket and see how it goes. – Peter Mar 06 '11 at 23:09
-
@Peter: Did you ever get anywhere parsing the live stream from an IP camera? I'm trying to do the same thing. – blachniet Jan 04 '13 at 21:02
-
@blachniet - I looked into the code to see how feasible it seemed, but quickly decided it was way outside the level of effort I was willing to put into it. Last time I looked into this I was heading down the path of using either a .NET wrapper for VLC, or Emgu CV. My goal was cross-platform supporting using Mono, and I believe both of these are doable, and Emgu CV for certain. – Peter Jan 04 '13 at 21:16