IT Community - Software Programming, Web Development and Technical Support

Reading WMV file meta data in .Net

This is a discussion on Reading WMV file meta data in .Net within the C# Programming forums, part of the Software Development category; Reading WMV file metadata is quite simple when we using the WindowsMediaPlayerClass. I have given the Steps below. here in ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-15-2007, 11:18 PM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Reading WMV file meta data in .Net

Reading WMV file metadata is quite simple when we using the WindowsMediaPlayerClass.

I have given the Steps below. here in this sample code i have stored the metadata
in a datagridview.

1. Open a Window Application project in .NET 2.0

2. Add Windows Media Player (WMP.dll) component reference to the project

3. Place a datagridview control in the form

4. Add a button the form.

5. Copy the below code snippets and paste it in the button click event


WMPLib.WindowsMediaPlayerClass mediaPlayer = new WMPLib.WindowsMediaPlayerClass();
WMPLib.IWMPMedia mediaItem = mediaPlayer.add(@"D:\samplefile.wmv");


DataTable dtc = new DataTable();
DataRow drc;
dtc.Columns.Add(new DataColumn("Property", typeof(string)));
dtc.Columns.Add(new DataColumn("Value", typeof(string)));

for (Int32 attrIndex = 0; attrIndex < mediaItem.attributeCount; attrIndex++)
{
drc = dtc.NewRow();
drc[0] = mediaItem.getAttributeName(attrIndex);
drc[1] = mediaItem.getItemInfo(mediaItem.getAttributeName(a ttrIndex));
dtc.Rows.Add(drc);
}
DataView dvc = new DataView(dtc);
dataGridView1.DataSource = dvc;
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/c-programming/1721-reading-wmv-file-meta-data-net.html
Posted By For Type Date
Oxygen_dweb's bookmarks on del.icio.us This thread Refback 08-02-2007 06:23 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading IPTC data from Nikon camera RAW images,JPEG,TIFF files using Adobe dll in C# oxygen C# Programming 1 02-28-2008 11:33 PM
Reading and Writing to File using UTL_FILE in ORACLE Murali Database Support 2 08-23-2007 11:12 PM
reading data from a file using C# oxygen C# Programming 2 08-23-2007 01:48 AM
Which is faster- Reading word size data whose starting address is at even or at odd a Arun Computer Hardware 0 07-18-2007 09:03 AM
Reading and writing EXIF meta data from jpg/jpeg,tiff images oxygen C# Programming 0 07-15-2007 11:24 PM


All times are GMT -7. The time now is 04:19 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0