Determine the video clip size

Is there a general way to get the height and width of a video and other metadata (like timestamp when taking a video, etc.) using .NET? I would like to get information about the size of conventional video formats such as .avi

, .mpg

, .mpeg

, .mov

, .asf

, etc.

+2


source to share


1 answer


I don't know if this is the right fit for this, but with DirectX you can use the video class in the AudioVideoPlayback namespace to get the default video size. After creating the Video object, you can get the DefaultSize property from which you can get the height and width.

Simple example:



    Video video = new Video(videoPath, false);
    Size size = video.DefaultSize;

    Console.WriteLine("Width: " + size.Width);
    Console.WriteLine("Height: " + size.Height);

      

+2


source







All Articles