VB.NET - DirectX.AudioVideoPlayback 给出的帧大小不正确?

发布于 2024-09-03 14:33:34 字数 454 浏览 2 评论 0原文

嘿,制作一个媒体播放器,需要了解一些东西。

我有一个读取文件信息的菜单,但由于某种原因,当我打开一个我知道尺寸为 1280x720 的视频时,宽度和高度变为 1292x758。

编辑:

当我打开一个 640x480 的视频时,它说它是 656x518

那个,并且弹出一个额外的预览框,因为:

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

需要播放该视频,以便我可以获得帧速率,但是一旦我有了帧率?

使用 VB.NET Framework 4.0 工作。 (VS2010)

非常感谢这些问题的答案。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

前事休说 2024-09-10 14:33:34

知道了。我必须在所有模块之外将视频调暗,并将自动播放设置为 false,然后我可以从视频中获取所有属性,而无需不断地在多个线程上打开视频。

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

然后我所要做的就是使用“openerfile”及其属性来实现我的愿望。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文