views:

123

answers:

1

Hey, making a media player and need to know something.

I have a menu which reads file info, but for some reason, when I open a video that I KNOW is 1280x720, the width and height come up as 1292x758.

Edit:

When I open a video which is 640x480, it says it's 656x518

That, and an extra preview box pops up due to:

labFR.Text = "Frame rate: " & Strings.FormatNumber((1 / AudioVideoPlayback.Video.FromFile(labinput.text, True).AverageTimePerFrame), 3)

This needs to be playing so I can get the frame rate, but how to I close it once I have the frame rate?

Working in VB.NET Framework 4.0. (VS2010)

Answers to either of these problems are highly appreciated.

A: 

Got it. I have to Dim the Video outside of all the modules with autoplay set to false, then I can grab all the properties from the video without constantly opening the video on several threads over and over.

Dim openerfile As Video  
Public Sub btnInputBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInputBrowse.Click
     openerfile = Video.FromFile(labinputfile.Text, False) 'labinputfile is a textbox which is given the path of an openfiledialog  
End Sub

Then all I have to do is use "openerfile" and its properties for what I wish.

Yiu Korochko