LennardF1989

Hi there,

I'm building a simple Movie Viewer, but I have a small issue with the AudioVideoPlayback API. For some reason, it sometimes lock's the Aspect Ratio (and will add black bars to keep it) but other times it will just stretch the picture. I'm totally lost, since I can't find a solution.

Here's the Basic code I use:

Code Snippet

Private VideoPlayer As Video

Private OpenFile As String = Nothing

Private VideoContainer As Panel

Private AspectRatio As Double

Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click

Dim frmOpenFile As New OpenFileDialog

frmOpenFile.Multiselect = False

frmOpenFile.ShowDialog()

If frmOpenFile.FileName <> Nothing Then OpenFile = frmOpenFile.FileName

End Sub

Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem5.Click

If OpenFile <> Nothing Then

VideoPlayer = New Video(OpenFile, True)

VideoPlayer.Owner = Panel1

End If

End Sub

Ps. Panel1 is a Panel which is Docked (Fill Style) on the Form

Does someone knows a way to force the video to lock the aspect ratio, so it will add black bars on the left/right and/or top/bottom when resizing the form

Best Regards,

Lennard Fonteijn

Ps. It is true that this way of viewing a file only needs DirectX installed with the corresponding codecs (or does DShow needs filters Tongue Tied Are codecs also filters ) for the file right I don't want to use the WMP APi, since that will require the user to have WMP installed and it isn't as customizeable as this (IMHO).




Re: Media Foundation Development Lock Aspect Ratio with Microsoft.DirectX.AudioVideoPlayback

LennardF1989

Bump! I really need an answer...




Re: Media Foundation Development Lock Aspect Ratio with Microsoft.DirectX.AudioVideoPlayback

Feng Chen - MSFT

Hi LennardF,
I am moving this thread from Visual Basic Express Edition forum to the Media Foundation Development forum, since the issue is related to Direct X Media PlayBack. There are more Direct X Media experts in the Media Foundation Development forum.
Thanks for your understanding!





Re: Media Foundation Development Lock Aspect Ratio with Microsoft.DirectX.AudioVideoPlayback

Chrobione

Has anyone figured out an answer to this question




Re: Media Foundation Development Lock Aspect Ratio with Microsoft.DirectX.AudioVideoPlayback

LennardF1989

Are you having the same problem




Re: Media Foundation Development Lock Aspect Ratio with Microsoft.DirectX.AudioVideoPlayback

Becky Weiss - MSFT

You might have better luck with this question on the DirectShow forum: http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=129&SiteID=1