devkanro / Meta.Vlc

Meta.Vlc is a LibVlc wrapper for WPF.
Do What The F*ck You Want To Public License
274 stars 85 forks source link

Help Wanted - How to configure vlcPlayer.LoadMedia() for a usb camera #261

Open robZeilinga opened 6 years ago

robZeilinga commented 6 years ago

Hello - Can you please add an example to the getting started pages in the wiki to demonstrate how to start the VlcPlayer using a directShow input?

i.e. VlcPlayer.LoadMedia("DSHOW://", new string[] {":dshow - vdev = USB 2.0 PC Cam"});

many thanks RobZ

Estalhun commented 6 years ago

Try Player.VlcMediaPlayer.Media?.Dispose() Player.VlcMediaPlayer.Media = Player.VlcMediaPlayer.VlcInstance.CreateMediaFromLocation(myUri.ToString) Player.VlcMediaPlayer.Media.AddOption(":dshow-adev=none") Player.VlcMediaPlayer.Media.AddOption(":dshow-vdev=HD WebCam")
Player.VlcMediaPlayer.Media.AddOption(":dshow-aspect-ratio=4:3") Player.VlcMediaPlayer.Media.ParseAsync() Player.Play()

            If Player.VlcMediaPlayer.CanPlay = True Then
                myVLC_ok = True
            End If

Catch ex As Exception MsgBox("Error") End Try

qinjianzhanqing commented 6 years ago

同样遇到这个问题,求解答