xZune.Vlc - LibVlc wrapper for WPF

This forum is about all development around libVLC.
higan
New Cone
New Cone
Posts: 6
Joined: 18 Feb 2016 17:17

xZune.Vlc - LibVlc wrapper for WPF

Postby higan » 18 Feb 2016 17:29

xZune.Vlc is an LibVlc solution for .NET, it has encapsulated most of functionalities of LibVlc.
This project aims to find a perfect solution for using Vlc on WPF.
xZune.Vlc provides an native WPF control(xZune.Vlc.Wpf), this control achieves video playback by utilizing InteropBitmap and shared memory.
Since it’s a native WPF control, it doesn't suffer from HwndHost’s airspace issue.

Project home page:
https://github.com/higankanshi/xZune.Vlc

Quick start on xZune.Vlc:
https://github.com/higankanshi/xZune.Vlc#quick-start

Api Documentation:
http://higan.me/xZune.Vlc/api/index.html

NuGet Packages:
Install xZune.Vlc

Code: Select all

PM> Install-Package xZune.Vlc
Install xZune.Vlc.Wpf

Code: Select all

PM> Install-Package xZune.Vlc.Wpf
Install xZune.Vlc.Lib

Code: Select all

PM> Install-Package xZune.Vlc.Lib

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: xZune.Vlc - LibVlc wrapper for WPF

Postby Jean-Baptiste Kempf » 19 Feb 2016 09:22

Hey, that's pretty cool! Thanks
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

ZeBobo5
Blank Cone
Blank Cone
Posts: 17
Joined: 17 Nov 2006 11:38

Re: xZune.Vlc - LibVlc wrapper for WPF

Postby ZeBobo5 » 22 Mar 2016 17:18

Hi,

Using InteropBitmap is not recommended to display images as video due to memory leaks which can cause BSOD and a lot of memory usage (when you played a video in loop for few hours)... That's why I changed the code of Vlc.DotNet which --I think-- you have inspired.

I can also do unsafe code, but the purpose of Vlc.DotNet is to not have a single line of code unsafe.

Microsoft is preparing a new implementation using DirectX for image rendering in WPF, and I'm waiting to implement it.

higan
New Cone
New Cone
Posts: 6
Joined: 18 Feb 2016 17:17

Re: xZune.Vlc - LibVlc wrapper for WPF

Postby higan » 22 Mar 2016 21:26

Hi,

Using InteropBitmap is not recommended to display images as video due to memory leaks which can cause BSOD and a lot of memory usage (when you played a video in loop for few hours)... That's why I changed the code of Vlc.DotNet which --I think-- you have inspired.

I can also do unsafe code, but the purpose of Vlc.DotNet is to not have a single line of code unsafe.

Microsoft is preparing a new implementation using DirectX for image rendering in WPF, and I'm waiting to implement it.
Hi,

Yes, I have used Vlc.DotNet in my project(xZune), but I found I can't put any control on Player, so I write a LibVlc wrapper for it(xZune.Vlc).
Then I found it is not easy to use, so I create a control for it(xZune.Vlc.Wpf), I think many people need it for WPF Application, so I make it open-source.

xZune.Vlc is only want to provide a native WPF control, and you can create a Cool Player Application with WPF.

Also xZune.Vlc is not perfect, it has many problem about Multi-thread, play control and deadlock.
In early version of xZune.Vlc, stop media is not a easy work, and it will case deadlock in sometime, it is still not perfect now, you must use it by those code:

Code: Select all

Player.BeginStop(() => { // After stop. });
But xZune.Vlc have solved some flaw of LibVlc, like: interactive with DVD menu when you play video with video callback (#5), DAR and SAR error with some video (#32).

About InteropBitmap, I have test it, I play a video(1920x1080 H.264 AAC) loop in two hours, this is memory usage log:
02:03 AM - 188.3MB
02:35 AM - 179.2MB
02:51 AM - 148.7MB
03:13 AM - 146.4MB
03:34 AM - 149.9MB
03:46 AM - 163.8MB
04:10 AM - 162.1MB
04:14 AM - 156.1MB
04:19 AM - 149.2MB

I think it is in the acceptable range, at present. I will continue test it in next day.

Thank you.

-----------

New test result:
15:42 PM - 151.4MB
20:18 PM - 163.1MB
21:39 PM - 166.7MB


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 19 guests