I searched alot for a way to get details of a video file, without the need of a third party component. Im developing a video library on my free time, and I wanted the user to get this data automatically after selecting the video. The class uses shell32.dll which is what Windows Explorer uses to get the video details, and is available in every Windows installation. I tested my app on Windows XP and Vista. So to use this dll just open the Add Reference dialog box, select the COM tab, select Microsoft Shell Controls And Automation and click OK.

using System.Windows.Forms;
using System;
using System.IO;

/// 
/// This class gets the movie file's details using the windows shell
/// 
public class MovieFileDetails
{
    private Shell32.Shell Sh = new Shell32.Shell();    
    private Shell32.Folder F;
    private Shell32.FolderItem FI;

	/// 
	/// The runtime (play time) of the movie
	/// 
	public readonly string Runtime;

	/// 
	/// The screen resolution of movie (Format: Width X Height)
	/// 
	public readonly string Resolution;

	/// 
	/// The file size in MB of the movie
	/// 
	public readonly string FileSize;

	/// 
	/// The audio bitrate of the movie (Example: 127kbps)
	/// 
	public readonly string Audio;

	/// 
	/// Frame rates per second and total bitrate
	/// 
	public readonly string Video;

	public MovieFileDetails(string MovieFile)
	{
		//Got this using Windows Vista, didnt try it in XP or earlier releases
		//1 file size = 702 MB
		//27 length = 01:33:45
		//28 Audio Bitrate= 127kbps
		//262 data rate= 3kbps
		//263 frame height = 416
		//265 frame rate = 23 frames/second
		//265 frame width = 560
		//266 total bitrate = 130kbps

		if (System.IO.File.Exists(MovieFile))
		{
			try {
                F = Sh.NameSpace(System.IO.Path.GetDirectoryName(MovieFile));
                FI = F.ParseName(System.IO.Path.GetFileName(MovieFile));

                //set the fields
                Runtime = F.GetDetailsOf(FI, 27);
                Resolution = F.GetDetailsOf(FI, 265) + " X " + 
                    F.GetDetailsOf(FI, 263);

                //remove formatting, i.e. '701' instead of '701 MB'
                FileSize = F.GetDetailsOf(FI, 1).Substring(0,4).Trim();  

                Audio = F.GetDetailsOf(FI, 28);
                Video = F.GetDetailsOf(FI, 265) + ", Total BitRate: " + 
                    F.GetDetailsOf(FI,266);
			}
			catch (Exception ex) {
				const string MSG = "Could not get movie file information. ";
                MSG += "Please make sure the right codecs are installed";
				MessageBox.Show(MSG, Application.ProductName, 
                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
			}
		}
		else
		{
			MessageBox.Show("The file does not exist.", Application.ProductName, 
                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
		}
	}
}

An example that uses the class:

private void button1_Click(object sender, EventArgs e)
{
    MovieFileDetails movie = new MovieFileDetails("C:\\Video1.wmv");

    //e.g. 54kbps
    label1.Text = "Audio: " + movie.Audio + "\n";  

    //e.g. 6.11    
    label1.Text += "File Size: " + movie.FileSize + "\n";  
        
    //e.g. 240 X 320
    label1.Text += "Video Resolution: " + movie.Resolution + "\n"; 

    //e.g. 00:05:30
    label1.Text += "Runtime: " + movie.Runtime + "\n";  
    
    //e.g. 25 frames/second, Total BitRate: 350kbps
    label1.Text += "Video: " + movie.Video + "\n";  
}