Page 1 of 1

xZune.Vlc - LibVlc wrapper for WPF

Posted: 18 Feb 2016 17:29
by higan
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

Re: xZune.Vlc - LibVlc wrapper for WPF

Posted: 19 Feb 2016 09:22
by Jean-Baptiste Kempf
Hey, that's pretty cool! Thanks

Re: xZune.Vlc - LibVlc wrapper for WPF

Posted: 22 Mar 2016 17:18
by ZeBobo5
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.

Re: xZune.Vlc - LibVlc wrapper for WPF

Posted: 22 Mar 2016 21:26
by higan
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