GithubHelp home page GithubHelp logo

devkanro / meta.vlc Goto Github PK

View Code? Open in Web Editor NEW
276.0 37.0 84.0 34.92 MB

Meta.Vlc is a LibVlc wrapper for WPF.

License: Do What The F*ck You Want To Public License

C# 98.27% PowerShell 1.73%
vlc wpf media-library libvlc vlc-wpf vlc-libvlc meta

meta.vlc's Introduction

Meta.Vlc

Introduction

Meta.Vlc 是一个 LibVlc 封装库的 .NET 实现,封装了大部分的 LibVlc 的功能,该项目主要是为了寻求一个在 WPF 上使用 Vlc 的完美的解决方案,Meta.Vlc 提供一个原生的 WPF 播放控件(Meta.Vlc.Wpf),该控件采用 InteropBitmap 与共享内存进行播放视频,是一个原生的 WPF 控件,不存在 HwndHost 的空域问题.

Meta.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. Meta.Vlc provides an native WPF control(Meta.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.

Build Status Join the chat at https://gitter.im/higankanshi/Meta.Vlc

NuGet Packages

Install Meta.Vlc

PM> Install-Package Meta.Vlc 

For net45 and above, full x86 and x64 support is available. Meta.Vlc will add conditional references to handled x86, x64, and AnyCpu.

Install Meta.Vlc.Wpf

PM> Install-Package Meta.Vlc.Wpf 

For net45 and above, full x86 and x64 support is available. Meta.Vlc.Wpf will add conditional references to handled x86, x64, and AnyCpu.

Install Meta.Vlc.Lib

PM> Install-Package Meta.Vlc.Lib

Meta.Vlc.Lib 包含所有 LibVlc 的文件,你可以在 Meta.Vlc 与 Meta.Vlc.Wpf 中使用这些 Dll。
LibVlc 的版本:
2.2.0-Meta Weatherwax

Meta.Vlc.Lib includes all files of LibVlc. You can use these dlls for Meta.Vlc and Meta.Vlc.Wpf.
LibVlc Version:
2.2.0-Meta Weatherwax

Api Documentation

See the api documentation of Meta.Vlc.

.Net Support

.NET Version Meta.Vlc Meta.Vlc.Wpf Meta.Vlc.Wpf.Sample
.NET 2.0
.NET 3.0
.NET 3.5
.NET 4.0
.NET 4.5

⭕ :兼容/Compatible
❌ :不兼容/Incompatible
⁉️ :部分功能可能不可用/Some functions may not be available

Packaging NuGet

To generate package files there are a couple of important steps.

  • In Meta.Vlc\tools\net45\ and Meta.Vlc.Wpf\tools\net45 for each script, the $allowedReferences must have the Version match what the current dll's has set.
  • Everything else is normal, build the package using nuget pack Meta.Vlc.nuspec, nuget pack Meta.Vlc.Wpf.nuspec and nuget pack Meta.Vlc.Lib.nuspec

Change Log

2018/12/31

SHA1:e782eb7890b1cad1eac504c80954703db323a185

01.添加了 libvlc 3.0 支持
01.Add support for libvlc 3.0
在这次修改中,Meta.Vlc 支持了 libvlc 的 3.0 版本功能,由于一些 API 上的设计,这可能是一次破坏性的变更,2.x 版本的 libvlc 可能已经不再被支持了。也在这里再次感谢 Unbroken Software,没有他们帮助,3.0 版本的 Meta.Vlc 可能不会这么快的 Release。
In this modification, Meta.Vlc supports the 3.0 version of libvlc. Due to some API design, this may be a broken change. The 2.x version of libvlc may be supported no longer. Thanks again to Unbroken Software, without their help, the 3.0 version of Meta.Vlc may not be released so quickly.

02.移除了 .NET2.0 与 .NET3.0 的支持
02.No longger support for .NET2.0/.NET3.0
由于需要使用一些更高级的特性,所以我们在这次更新中移除了 Meta.Vlc 对于 .NET2.0 与 .NET3.0 的支持。
Due to the need to use some of the more advanced features, we removed Meta.Vlc support for .NET2.0/.NET3.0 in this update.

03.重构了整个与 libvlc 互操作的模块
03.Refactor interop module for libvlc
现在我们更加广泛的使用了 unsafe 操作以提升与 libvlc 的互操作性能,所以 Meta.Vlc 模块可能有十分巨大的改变,但是 Meta.Vlc.Wpf 几乎没什么变化。并且在这次重构中,重新实现了互操作的机制,让调用过程更加精炼。
Now we've used the unsafe operation more extensively to improve interoperability with libvlc, so the Meta.Vlc module can have a huge change, but Meta.Vlc.Wpf is almost unchanged. Moreover, in this refactoring, the interoperability mechanism has been re-implemented to make the calling process more refined.

2016/07/08

SHA1:5a882479bfe31345e95f5bb64a1debd858ad7758

01.添加 VideoFormatChanging 事件。
01.Add VideoFormatChanging event.
通过处理 VideoFormatChanging 事件来变更视频内容的解码大小与颜色格式。
You can handle VideoFormatChanging event to set decode size and format of video.

2016/05/01

SHA1:90c45ed791b96e9da65b926cc9738cbd4840988e

01.更改项目代号 xZune 为 Meta。
01.Change the code name to "Meta".
项目代号与更命名控件的变更,仅需要全局替换 "xZune" 为 "Meta",即可兼容此次变更。
Project code name and root name space have been changed, you can replace "xZune" to "Meta" to compatible this commit.

旧版本 Nuget 包仍然被提供,在这里查看旧版本 Nuget 包:
Old version Nuget package still be provided, check those:
xZune.Vlc
xZune.Vlc.Wpf
xZune.Vlc.Lib

2016/04/17

SHA1:3a4d2cc7ca1a1c1026047a07494641d4c8b38e3d

01.添加 Video Adjust 系列 API。
01.Add adjust APIs for video.
在 VlcMediaPlayer 中使用下列过滤器相关的 API 来为播放器提供过滤器。
Use those video adjust APIs in VlcMediaPlayer to control adjust.

Property              VlcMediaPlayer.IsAdjustEnable          get/set   bool
Property              VlcMediaPlayer.Contrast                get/set   float
Property              VlcMediaPlayer.Brightness              get/set   float
Property              VlcMediaPlayer.Hue                     get/set   float  
Property              VlcMediaPlayer.Saturation              get/set   float  
Property              VlcMediaPlayer.Gamma                   get/set   float  

2016/04/13

SHA1:7ffd3eb8616a6a364591809890688bda84b36501

01.添加 Subtitle 系列 API。
01.Add subtitle APIs.
在 VlcMediaPlayer 中使用下列字幕相关的 API 来控制播放器的字幕行为。
Use those subtitle APIs in VlcMediaPlayer to control subtitle.

Property              VlcMediaPlayer.Subtitle                  get/set   int
Property              VlcMediaPlayer.SubtitleDelay             get/set   long
Property              VlcMediaPlayer.SubtitleCount             get       int
Property              VlcMediaPlayer.SubtitleDescription       get       TrackDescription
Method                VlcMediaPlayer.SetSubtitleFile(String)             bool

2016/03/28

SHA1:72b6e0fa70d34c64b700e9bdeda8f9ca61731b9f

01.可为其他控件生成 VideoSource。
01.VideoSource can be used in other control.
由于呈现线程的改变,VideoSource 将属于呈现线程,而非默认 UI 线程,因此 VideoSource 不在能被默认 UI 线程的元素使用,但是我们为在其他控件使用 VideoSource 准备其他方案。 Due the change of display thread, VideoSource will belong to display thread, not the default UI thread. So VideoSource can't be used by UI element of default UI thread, but we provide another way to use VideoSource for other control.

查看 Use VlcPlayer with other controls 来获取如何在其他控件中使用 VideoSource 的教程。
See Use VlcPlayer with other controls to get more information about use VlcPlayer with other conttols.

2016/03/25

01.多线程的图片呈现方式。
01.Multi-Thread video display support. .
SHA1:5fff42c9f4a8c37b65107e23fdfd85ca9b42bfa4
现在我们将用于呈现视频的 Image 控件转移到高优先度的线程,降低由于 UI 操作(更新 UI 等)导致 UI 线程卡死从而导致视频卡顿。
但是目前最多能接受大约 500ms 的卡顿不会影响到视频播放,长时间的 UI 线程卡死仍然会导致视频卡顿,但是解码与呈现线程已经不和 UI 线程有交互。
导致这种情况的原因不明,初步断定为由于文件读写操作与 UI 线程有交互。
Now we move the Image control which used for display video to highest thread, it will reduce stuck when UI thread is busy.
But if UI thread is busy for long time, video still will stuck, but decode thread is not associated with UI thread any more.
No idea about this, but I think the video file IO is associated with UI thread.

02.VlcPlayer 处理 VLC 事件不在主 UI 线程同步处理。
02.VlcPlayer handle event of VLC no longer block the main UI thread.
SHA1:052ed5ec6c16fa43a3c50b8ec594c3176973b97e
完善 VLC 线程与 UI 线程之间的交互,现在 VlcPlayer 在处理 VLC 事件时不会在主 UI 线程上同步。
解决了当主 UI 线程卡死时,视频将暂停播放的问题,现在当主 UI 线程卡死时,视频仍然能够继续播放不受影响。
To improve the interaction between VLC threads and UI thread, VlcPlayer handle event of LibVlc will not sync invoke in main UI thread.
Solved video will be pause when main UI thread is stuck. Now even the main UI thread is stuck, the display will play go on.

03.移除 BeginStop 方法。
03.Remove the BeginStop method.
SHA1:052ed5ec6c16fa43a3c50b8ec594c3176973b97e
由于线程交互的完善,Stop 方法不再会阻塞线程导致死锁,因此 BeginStop 方法不再被需要。
Due to the improvement of thread interaction, Stop method will block the thread no longer, BeginStop method are no longer needed.

2016/02/14

SHA1:185dfe8d8c713c1ff10fadaaf0f97af2ecc3aabc

01.添加 VLM 系列 APIs。
01.Add VLM APIs.
你可以使用 Vlc 类提供的 Vlm*() 系列方法来使用 VLM 功能。
You can use the Vlm*() methods of Vlc class to use VLM functions.

2016/02/13

SHA1:6ec4d6aa5823702af6cafe8cb3d4c0ec3e58602a

01.提供更多结构体封装。
01.Wrap more sturct.
提供全新的各种结构体封装方式,更易于使用。
We changed the wrapper of each struct, make more easy to use.

02.更改 LibVlc 初始化方式。
02.Changed the LibVlc initialize mode.
提供新的 LibVlcManager 类来管理 LibVlc 的初始化,让初始化逻辑更清晰。
New LibVlcManager class to manage initialization of LibVlc.

03.添加更多的英文注释。 03.Add more English comment.

注意(Note):
本次更改更倾向于底层代码优化与清理,如果你主要使用 Meta.Vlc 而不是 Meta.Vlc.Wpf,你可能需要做比较多的更改来兼容这次变更。
如果你只是使用 Meta.Vlc.Wpf 只是部分涉及到 TrackDescription 结构,MediaTrack 结构,或是其他结构的 API 有小部分变更。

This commit is only changed and clear up some lowest layer code, if you using Meta.Vlc not Meta.Vlc.Wpf, maybe you should changed many code to compatible this commit.
If you using Meta.Vlc.Wpf, only some APIs about TrackDescription struct, MediaTrack struct or other struct have changed.

2016/02/13

SHA1:b5b6a020e041a0d9e9b1e911debdd606b4911971

01.支持音频设备系列 API。
01.Support audio dvice APIs.
新添加的 VlcPlayer.SetAudioDevice(AudioOutput audioOutput, AudioDevice audioDevice) 方法可以由指定的音频设备播放媒体的音频。
New audio dvice API VlcPlayer.SetAudioDevice(AudioOutput audioOutput, AudioDevice audioDevice) can select a audio device to display audio of media.

02.多 VLC 实例支持。
02.Mutil VLC instance support.
可以通过 VlcPlayer.CreateMode 属性来设置创建 VlcMediaPlayer 时是使用默认 VLC 实例或者新建一个 VLC 实例。
You can set create VlcMediaPlayer with default VLC instance or create a new VLC instance by VlcPlayer.CreateMode property.

Quick Start

在您的项目中快速使用 Meta.Vlc:
Quick start Meta.Vlc in your project:

01.在项目中添加对 Meta.Vlc 的程序集的引用。
01.Add the references of Meta.Vlc to your project.

Meta.Vlc.dll
Meta.Vlc.Wpf.dll

02.在项目的属性中设置 LibVlc 库的目录。
02.Set the path of LibVlc in properties of your project.
$(Your Project)\Properties\AssemblyInfo.cs中添加 VlcSettingsAttribute。
Add a VlcSettingsAttribute in $(Your Project)\Properties\AssemblyInfo.cs.

//设置 LibVlc 的目录
//Set the path of LibVlc
[assembly: VlcSettings(@"..\..\..\LibVlc")] 

//设置 LibVlc 初始化时的选项
//Set the path and options of LibVlc
[assembly: VlcSettings(@"..\..\..\LibVlc", "-I", "dummy", "--ignore-config", "--no-video-title" )]

参考:
See:
https://github.com/higankanshi/Meta.Vlc/blob/master/Meta.Vlc.Wpf.Sample/Properties/AssemblyInfo.cs

03.在 Xaml 中加入 VlcPlayer 控件。
03.Add the VlcPlayer Control in your Xaml

<wpf:VlcPlayer xmlns:wpf="clr-namespace:Meta.Vlc.Wpf;assembly=Meta.Vlc.Wpf" x:Name="vlcPlayer"/>

04.载入媒体并播放。
04.Load and Play the media.

vlcPlayer.LoadMedia(@"C:\VlcTest.mp4");             //载入本地文件    Load a local file
//vlcPlayer.LoadMedia(@"H:\");                      //载入DVD光盘     Load a DVD
//vlcPlayer.LoadMedia(new Uri("http://127.0.0.1")); //载入网络流      Load a Network Stream
vlcPlayer.Play();                                   //播放媒体        Play the media

05.停止媒体与释放资源。
05.Stop the media and Release the resources.

vlcPlayer.Stop()可以用于停止媒体的播放。 vlcPlayer.Stop() used for stop the Player.

VlcPlayer.Stop();
VlcPlayer.Play(); // 重载媒体。         Replay media.

可以在程序结束时调用vlcPlayer.Dispose()释放所有资源。
You can call the vlcPlayer.Dispose()to release the resource when you exit.

06.为音频输出使用均衡器(需要 LibVlc 2.2.0 以上)。
06.Add equalizer for audio(Need LibVlc 2.2.0 and higher).

使用 AudioEqualizer 为音频提供均衡器,并提供 18 种预置均衡器与 10 个可自定义放大数值的频带。
Now we can use AudioEqualizer to provide equalizer for VlcPlayer, have 18 preset equalizers and 10 frequency bands.

//使用预置的均衡器设置初始化均衡器。
//use preset equalizer setting to initilaize AudioEqualizer.

AudioEqualizer ae = new AudioEqualizer(PresetAudioEqualizerType.Classical);
Player.AudioEqualizer = ae;


//使用默认设置初始化均衡器,并为 10 个频带赋值。
//use default setting to initilaize AudioEqualizer and set every frequency bands.

AudioEqualizer ae = new AudioEqualizer();
ae.Preamp = 12;
ae[0] = -1.11022E-15f;
ae[1] = -1.11022E-15f;
ae[2] = -1.11022E-15f;
ae[3] = -1.11022E-15f;
ae[4] = -1.11022E-15f;
ae[5] = -1.11022E-15f;
ae[6] = -7.2f;
ae[7] = -7.2f;
ae[8] = -7.2f;
ae[9] = -9.6f;
Player.AudioEqualizer = ae;

注意(Note):
Meta.Vlc.VlcMediaPlayer 不会引用均衡器实例,仅会复制其值,但是 AudioEqualizer 提供了属性变更通知,你可以使用其属性变更事件来重新设置均衡器。
Meta.Vlc.Wpf.VlcPlayer 会引用均衡器实例,并且监听了当前均衡器的属性变更事件,当当前均衡器有变更会自动的为 VlcMediaPlayer 重新设置均衡器。

The Meta.Vlc.VlcMediaPlayer will not keep a reference to the supplied equalizer so you need set it again after you changed some value of AudioEqualizer, we provide PropertyChanged event for AudioEqualizer you can use this to reset equalizer.
The Meta.Vlc.Wpf.VlcPlayer will keep a reference to the supplied equalizer, when you changed some value of AudioEqualizer, it will auto reset equalizer for VlcMediaPlayer.

07.循环播放视频。
07.loop the media.
通过设置 EndBehavior 来设置当媒体播放完毕后的动作,支持 Nothing,Stop,Repeat 三种模式。
当设置为 Nothing 时,会什么都不做,屏幕仍然会显示最后一帧的画面,你需要先将播放器停止才能重新播放视频。
当设置为 Stop 时,会自动停止视频,屏幕会被清空,并且可以直接使用播放方法重新播放视频,这是默认的行为。
当设置为 Repeat 时,会自动的重新播放视频。

You can set the EndBehavior property to set behavior when media ended. Support Nothing,Stop,Repeat mode.
If you set it to Nothing, player will do nothing after media ended, you need stop it, and you can play again.
If you set it to Stop, player will set to stop.
If you set it to Repeat, player will atuo play again media.

08.特殊的 VLC 功能。
08.Some other extension for VLC.
Meta.Vlc 使用了某些 VLC 的拓展功能,我们目前提供 LibVlc(2.2.0-Meta) 32bit 版本。如果您需要在更低或者更高的 VLC 版本上使用 Meta.Vlc,您可能需要自己编译 VLC for Meta.Vlc,以保证 Meta.Vlc 拓展功能可用。
Meta.Vlc has used some "Expansions" for VLC, we are providing LibVlc(2.2.0-Meta) 32bit version now.But you want to use Meta.Vlc with later or lower version,you could need compile VLC for Meta.Vlc by yourself,to ensure that the expansions are available.

查看 Compile VLC for Meta.Vlc 来获取编译 Meta 专用的 VLC 教程。
See Compile VLC for Meta.Vlc to get some infomation about compile VLC for Meta.

Special Thanks

非常感谢
Special thanks for support

Unbroken Software
虽然这是一个开源项目,但我和 Unbroken Software 有过一些十分愉快的商业合作,这个项目也得到了他们的捐助,在此十分感谢他们的支持。
Although this is an open source project, I have had some very pleasant business cooperation with Unbroken Software. This project has also received their donation, and I am very grateful for their support.

Other Project

已经在使用 Meta.Vlc 的项目:
Already in use Meta.Vlc:

FoscamController
This is a Library and Demo WPF program for controlling MJPEG and HD models of Foscam IP PTZ (Pan-Tilt-Zoom) Cameras and displaying MJPEG and H.264/RTSP video.

FiloStreamer
FiloStreamer is a simple GUI application frontend on top of ffmpeg, designed to simplify and ease configuring and setting up local live stream from a Blackmagic Decklink card source.

SenpaiCopy
SenpaiCopy is a simple tool to copy image and video files from a source folder to one or more other folders. It supports a variety of image and video formats, with more to come in the future. It also allows for quickly searching an image on google. SenpaiCopy is made for people with huge amounts of folders to sort images into.

Popcorn
An application which aims to provide a simple interface to watch any movie.

Videre
A simple, yet effective video player.

TwitchViewer
A simple Twitch client that uses Vlc and Livestream to watch twitch streams.

Meta 媒体套件:
Meta Media Suit:

Meta.Bass
Meta.Bass 是 Bass 库的 .NET 封装实现,用于多种格式的音频播放与解码。
Meta.Bass is a Bass library wrapper for .NET, used to play/decode mutil format audio.

Meta.Visualizer
Zune 风格的音频可视化控件。
Zune style audio visualizer.

meta.vlc's People

Contributors

birbilis avatar deadpikle avatar dennisgranasen avatar devkanro avatar endercrest avatar kmcginnes avatar larswesselius avatar longdog avatar mshumilov avatar ryogo-x avatar sergey-terekhin avatar vince-cheung avatar yaheath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meta.vlc's Issues

Not loading media after playing one

Hi!

I have a problem with loading media after another media was played.
When getting player state Ended, i trying to load another media? but nothing is going on:

void VlcPlayer_StateChanged(object sender, ObjectEventArgs<xZune.Vlc.Interop.Media.MediaState> e)
        {
            switch (e.Value)
            {
                case xZune.Vlc.Interop.Media.MediaState.Buffering:
                    Console.WriteLine("Buffering");
                    break;
                case xZune.Vlc.Interop.Media.MediaState.Ended:
                    Console.WriteLine("Ended");
                    /*
                     * Application freeze
                    VlcPlayer.LoadMedia(nexturi);
                    VlcPlayer.Play();
                    */
                    VlcPlayer.BeginStop((ar) =>
                    {
                        Console.WriteLine("loading next video");
                        VlcPlayer.LoadMedia(nexturi);
                        VlcPlayer.Play();
                    });
                    break;
                case xZune.Vlc.Interop.Media.MediaState.Error:
                    Console.WriteLine("Error");
                    break;
                case xZune.Vlc.Interop.Media.MediaState.NothingSpecial:
                    Console.WriteLine("NothingSpecial");
                    break;
                case xZune.Vlc.Interop.Media.MediaState.Opening:
                    Console.WriteLine("Opening");
                    break;
                case xZune.Vlc.Interop.Media.MediaState.Paused:
                    Console.WriteLine("Paused");
                    break;
                case xZune.Vlc.Interop.Media.MediaState.Playing:
                    Console.WriteLine("Playing");
                    break;
                case xZune.Vlc.Interop.Media.MediaState.Stopped:
                    Console.WriteLine("Stoped");
                    break;
                default:
                    Console.WriteLine("Default");
                    break;
            }
        }

Screenshot:
image

Send cookies header

So, i want to play a mp4 file from a server, the server requires a cookie to be set, is that possible?

On close exception, TaskCanceledException

When i close the app i get TaskCanceledException here:
public void Display() { if (Application.Current != null) { Application.Current.Dispatcher.Invoke(new Action(() => { Image.Invalidate(); })); } }

On Closing i dispose like this:

await VlcPlayer.StopAsync(); VlcPlayer.Dispose();

Error if stream url could not be opened

It would be great if payer.LoadMedia would cause an own error if the stream URL could not be opened ( for example the host is not awailable or the stream URL is not correct).

Is this possible?

Take snapshot of video

It would be useful to have a function that returns a snapshot of the video (Like VLC Media Player)

Switch audio channel/track

DVD movies and MKV video files can have multiple audio tracks (for example in different languages) and VLC supports that. It would be nice if we had a list of all available sound tracks with their title/description and were able to switch between them.

Subtitle support

I may be missing something but I don't see any function or property for setting subtitle and changing its settings. We need support for embedded subtitles (Providing a list of all subtitles available and the ability to select the desired one. This is specially useful for DVD/Blu-ray Movies), external subtitle (From file) and something like SubtitleOptions to set seed, encoding, font, size, position, etc.

Change Volume

Hi,
is in xZune.VLc a chance to set a Volume?

Thanks for answer
Ludek

Problem with Stop

Hello.

I use the fork and It seems that player.VlcMediaPlayer.Media.Stop() is not working. The application freezes if I use it. I had a look on it, but I can't find a mistake.

Can you have a look on it?

Can I get decoded frame data?

I'm working on some sort of cv job, need decoded image directly send to my code for follow up processing. Display is not needed in my case, all I need is efficent data copy. Snapshot maybe not efficent enough. So is there any way to get every frame data?

How to set fullscreen mode

Hi!

Is any function to set fullscreen mode?

I tried to load media with option:

VlcPlayer.BeginStop((ar) =>
            {
                VlcPlayer.LoadMediaWithOptions(uri, "fullscreen"); // --fullscreen, :fullscreen
                VlcPlayer.Play();
            });

But nothing is going on.

And one more moment, when mediastate is Ended i trying to load another media but nothing in going on:

void VlcPlayer_StateChanged(object sender, ObjectEventArgs<Interop.Media.MediaState> e)
        {
            if (e.Value == Interop.Media.MediaState.Ended)
            {
                VlcPlayer.BeginStop((ar) =>
                {
                    VlcPlayer.LoadMedia(nexturi);
                    VlcPlayer.Play();
                });
            }
        }

comments

Hi,
what are the changes of having English comments instead of Chinese?

Snapshot creation error

TakeSnapshot drops with NullReferenceException in code

switch (_snapshotContext.Format)
                { ...

(file /xZune.Vlc.Wpf/VlcPlayer.cs)

Pull Request #21

.Net 4.5 branch

It seems the only reason this awesome project isn't getting enough attention and many people use the alternatives (which are not even close to this project in terms of features) is the use of C# 6 specific features. It cannot be opened in Visual Studio 2013 and VS 2015 is still on RC state. Although VS 2015 is set to be released in a week or so from now, requiring users to have .Net 4.6 installed on their machine is not practical for at least a year.
So I suggest you maintain a .Net 4.5 branch in parallel with the main branch (Like most other projects) so all developers can benefit from this great project ...

DVD movie chapter support

Most DVD movies consist of multiple chapters ... There needs to be a list of all chapters and a property to set/get the current chapter.

Error in VS2015 XAML designer when selecting the player in the XAML

At MainWindow.xaml of .net 4.5 test project in VS2015, when clicking on <wpf:VlcPlayer x:Name="Player"/> in the XAML editor, I get in the designer area:

NullReferenceException: Object reference not set to an instance of an object.

StackTrace
at xZune.Vlc.Wpf.VlcPlayer.get_AudioOutputChannel()

InnerException: None

Memory Leak

Hi higankanshi im using your wrapper library in WPF, the issues i have is memory leak. I run 9 instances in a single WPF form and stream from 9 different RTSP links, after 3 hours the memory usage raise from 400 MB to 750 MB and make the player hangs. Can you please resolve this issue?

Thank you

Application freezes on VlcPlayer.Dispose()

When trying to close the window, application freezes. Using .NET 4.5:

        public MainWindow()
        {
            InitializeComponent();

            this.Closing += Window_Closing;

            var d = new OpenFileDialog();
            if (d.ShowDialog() == true)
            {
                mediaPlayer.LoadMedia(d.FileName);
                mediaPlayer.Play();
            }
        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            mediaPlayer.Dispose();
            ApiManager.ReleaseAll();
        }

Setting LibVlcPath property doesn't work

If I add [assembly: VlcSettings(@"..\..\..\LibVlc")] to my AssemblyInfo.cs everything's fine, but if I want to set the controls property, it won't work and I get the exception System.InvalidOperationException: Sequence contains no matching element. Here's how I'm doing it:
<vlc:VlcPlayer x:Name="mediaPlayer" LibVlcPath="..\..\..\LibVlc\" />

Error on initialization

I'm trying to check out the project but I'm stuck very early. I've linked the two projects (xZune.Vlc and xZune.Vlc.Wpf) and my wpf:VlcPlayer is declared in my xaml. When InitializeComponent is launched, an exception related to OnInitialized method of VlcPlayer occurs.

InvalidOperationException: "Sequence contains no matching element"
More details in the screenshot:
sans-titre-2

Seems to be linked to the assembly, but I'm not really aware of what's going on.

关于在线视频往回拖拽的问题

在本地进度条可以任意拖拽,播放在线视频的时候。可以往后拖拽,却不能往前拖拽。即如果我在看第10分钟,我可以拖到10分钟以后的任意位置观看,却不能拖到10分钟以前的位置。视屏会卡掉或者直接从第10分钟继续播放,您知道是怎么回事吗?

COMException in VideoDisplayContext constructor

Hi,

I'm developing an application for CCTV monitoring. I've found your VLC wrapper to be the best one of all which I tried, btu unfortunately I've run into some issues recently. My requirement is to display image from at least several ip cameras. As far I was able to run 8 simultaneously without issues. However when I try to add next ones, I got the "System.Runtime.InteropServices.COMException (0x80070008): Not enough storage is available to process this command" exception in the VideoDisplayContext constructor while invoking Imaging.CreateBitmapSourceFromMemorySection() method.

Not sure what to do with it... Would be grateful for any advices.

Loop Video

How would I go about looping a video?
I tried
VlcPlayer.LoadMediaWithOptions(path, "repeat"); //and also --repeat, --loop and loop
VlcPlayer.Play();

But it doesnt work. Any help?

There is a problem with the aspect ratio!

I did a fast sample to test it, and got a video 16:9, in classic media player it's 16:9 in xZune.Vlc it's transformed to 16:10 why? Well maybe 16:9.5, it's annoying, is there a way to keep aspect ratio?

High CPU usage

Hello @higankanshi
Your WPF implementation of libVlc uses almost 2x CPU time of the standalone VLC application.
How can we reduce this value?

NullReferenceException with code of WPF sample application

I am trying to get the sample WPF code to work. I basically copied the code from MainWindow.xaml and MainWindow.xaml.cs into my code. However, whenever I input a working rtsp stream into the Textbox and press Load, a NullReferenceException appears at VlcPlayer.BeginStop([...]). The error comes from xZune.Vlc.Wpf.dll. I'm on VS 2015 and .Net 4.6

Disable logger interface

I may be missing something, but how can I disable the logger interface window from showing up? This also happens in Release mode.

Winforms support

Have you dropped winforms support. Does this now only work with WPF ?

Interactive DVD menu

This project is great and we want to use it as part of a big project. Thought can you add mouse/keyboard interaction to the VLC control? Since it's just an image, you can't interact with DVD menus which is extremely important for a media player. All mouse/keyboard events should be hooked and passed to the media player.

StopAsync() 會卡住,並引起類似#29的問題

我修正了一下,不會造成卡住,結束時也不會發生類似#29的問題,但我好像Pull request失敗,無法給您參考
await System.Threading.Tasks.Task.Run(() =>
{
while (_stopping)
{

            }
        }).ContinueWith((a) =>
        {
            VlcMediaPlayer.Stop();

            if (_context != null) _context.Dispose();
            _context = null;

        });
        VideoSource = null;

4:3 instead of 16:9

Hello!
I have a network stream with ts container. Video resolution is 720x576. Everything works fine, but there is one problem: wrong aspect ratio (4:3 instead of 16:9).
VLC for Windows opens this stream with correct aspect ratio. Screenshots attached.
I've tried "--aspect-ratio=16:9" in options, but no luck.
Any suggestions?
Thanks!
VLC Player
WPF App with xZune.Vlc

Provide LibVlc directory only before loading media

Currently the directory of LibVlc should be specified before initialization and therefore should be hard-coded in the application. But that directory should not be needed before loading media and we should be able to specify the directory location at run-time. The main use would be to set different paths based on process CPU architecture. If the process is running in 64 bit mode, the property should point to the 64 bit version of LibVlc else it won't be initialized properly ...
So please initialize LibVlc before loading the media, not in control initialization.

Passing string to VlcPlayer.LoadMedia in Stop callback throws exception

This code works fine:

OpenFileDialog d = new OpenFileDialog();

            if (d.ShowDialog() == true)
            {
                player.BeginStop((ar) =>
                {
                    player.LoadMedia(new Uri(d.FileName));
                    player.Play();
                });
            }

But when a file is already playing, using the code below throws exception:

OpenFileDialog d = new OpenFileDialog();

            if (d.ShowDialog() == true)
            {
                player.BeginStop((ar) =>
                {
                    player.LoadMedia(d.FileName);
                    player.Play();
                });
            }

The exception:

System.AccessViolationException was unhandled
  HResult=-2147467261
  Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
  Source=xZune.VLC
  StackTrace:
       at xZune.Vlc.VlcMediaPlayer.set_Media(VlcMedia value) in c:\Users\Sepehr\Desktop\xZune.Vlc-master\xZune.Vlc\VlcMediaPlayer.cs:line 468
       at xZune.Vlc.Wpf.VlcPlayer.LoadMedia(String path) in c:\Users\Sepehr\Desktop\xZune.Vlc-master\xZune.Vlc.Wpf\VlcPlayer.cs:line 721
       at WpfApplication1.MainWindow.<>c__DisplayClass2.<btnChange_Click>b__0(IAsyncResult ar) in c:\Users\Sepehr\Desktop\xZune.Vlc-master\WpfApplication1\MainWindow.xaml.cs:line 52
       at xZune.Vlc.Wpf.VlcPlayer.<>c__DisplayClassc.<BeginStop>b__a(IAsyncResult aresult) in c:\Users\Sepehr\Desktop\xZune.Vlc-master\xZune.Vlc.Wpf\VlcPlayer.cs:line 807
       at System.Runtime.Remoting.Messaging.AsyncResult.SyncProcessMessage(IMessage msg)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
       at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)
       at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
       at System.Threading.ThreadPoolWorkQueue.Dispatch()
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
  InnerException: 

Embed LibVlc into NuGet package

I believe the xZune.Vlc NuGet package should contain the LibVlc folder with the native libraries (not the xZune.Vlc.Wpf - that one will grab it via xZune.Vlc package dependency)

Looking at NuGet Package Explorer (the free GUI tool for NuGet at http://npe.codeplex.com), it seems to have some option for adding Native Libraries too, but not sure if that one is for C++ projects or something related to Interop etc.

Maybe could just drag-drop the LibVlc there under the "lib" folder it shows when you open the .nuspec file. Not sure if it can set the project to copy the LibVlc folder with those libs from the Packages folder NuGet makes at the solution level to the executable folder of one's project that uses the package (usually bin/Debug or bin/Release) as it does with the .net libs via the references it ads. Probably with the native libraries option it adds some build task, but still not sure if it can copy a subfolder or if it will lay all those dlls flat at the target .exe folder. Have to experiment and/or read some doc or ask on stackoverflow how this could be done

Audio playback stereo mode

VLC Media Player has 4 options for audio stereo mode: Stereo, Left, Right, Reverse stereo. It would be nice to have them

Playback speed

There should be a property to set playback speed. A float for example with default value of 1 ...

Playing network stream with parameter

Hello,

I am using xZune and I am very happy with it. In VLC Player I can set parameter if I want to Play a Network stream. The parameter can be for example:

:avformat-format=mxg

It is possible to set this parameter in xZune if I want to Play a Network stream?

Thanks.

Embed wpf:VlcPlayer into a UserControl

Is it possible to embed the WPF player into a UserControl? I tried putting the WPF control into a grid, but it launch a new window (titled VLC (Direct3D Output)) instead.

sans-titre-2

Callback for Media Loaded & "Preview" Once Loaded

Hey,

Just some questions on how to do things.

  1. Is there any sort of callback for when the media has finished loading? Currently, I'm using the VlcMediaPlayer.Media.DurationChanged event (after calling LoadMedia) to see when the media is finished loading, but this seems...not ideal.

  2. Is there any way to make the video player show the first frame of the video once the video is loaded? I don't want to play the video until the user clicks the play button, but it would be nice if the user had some visual indication that the video was loaded. I suppose I could mute the video, play it for a split second, and then pause it as a workaround?

Thank you! :)

Hey guys, we have provided another control "xZune.Visualizer" !

xZune.Visualizer is a Zune style audio visualizer.
You can use it for audio visualize.
Now it only support FFT sample data of BASS.
I will add more audio library support latter.

It is a sample app:
xZune

Is it not cool?
I have done some performance optimization about it, so it has a low CPU usage (1%~10%) with FFT 2048 sample , 0% ~ 5% with FFT 1024.

Also it is a open source project.
See it at: https://github.com/higankanshi/xZune.Visualizer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.