1

okay so i'm working with visual studio 2010.

I need to read out the resolution from a MPEG file. So that would be the video width en height.

I think I need to create a button linked to an openfiledialog.show(), and then get a property from the specified file, by passing it on to a function.

My question: Does vb.net has build-in methods to gather the property of a file? Or does one know a free com component that does it for me?

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
Rps
  • 277
  • 1
  • 5
  • 25

1 Answers1

2

I don't think MPG files have detailed meta data embedded in them. However, have a look at this post which explains how to get extended data from the tags stored with the file. If you right-click on the video file...Properties...Details, the file may have its Frame Width and Frame Height information filled in. You can extract this information, using the details from the link, to get the relevant information.

Community
  • 1
  • 1
keyboardP
  • 68,824
  • 13
  • 156
  • 205
  • I tried using the link you gave, however, the information outputted by this function is not complete. In the property's windows of my mpeg file i clearly see the dimensions. The outputef file however gives this: 0 Name: Movie2 1 Size: 1,39 GB 2 Item type: Movie Clip 3 Date modified: 10/06/2011 0:48 4 Date created: 11/06/2011 16:51 5 Date accessed: 11/06/2011 16:51 6 Attributes: A 7 Offline status: 8 Offline availability: 9 Perceived type: Video 10 Owner: MYCOMPUTER 11 Kind: Video 12 Date taken: 13 Contributing artists: 14 Album: 15 Year: 16 Genre: – Rps Jun 11 '11 at 16:06
  • 17 Conductors: 18 Tags: 19 Rating: Unrated 20 Authors: 21 Title: 22 Subject: 23 Categories: 24 Comments: 25 Copyright: 26 #: 27 Length: 00:37:49 28 Bit rate: ‎192kbps 29 Protected: 30 Camera model: 31 Dimensions: 32 Camera maker: 33 Company: 34 File description: – Rps Jun 11 '11 at 16:06
  • As you can see; item 32: Dimensions remains empty – Rps Jun 11 '11 at 16:07
  • Is more information provided if you follow the advice in the comments about increasing the `arrHeaders` size? – keyboardP Jun 11 '11 at 16:21
  • so far only these items look helpfull, but they also remain empty: 160 Bit depth: 161 Horizontal resolution: 162 Width: 163 Vertical resolution: 164 Height: – Rps Jun 11 '11 at 16:41
  • okay i found it, it was somewhere in the range 250-300 that i saw the width and heigt vallues passing by. Thanks for your help man! – Rps Jun 11 '11 at 16:45