devkanro / meta.vlc Goto Github PK
View Code? Open in Web Editor NEWMeta.Vlc is a LibVlc wrapper for WPF.
License: Do What The F*ck You Want To Public License
Meta.Vlc is a LibVlc wrapper for WPF.
License: Do What The F*ck You Want To Public License
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;
}
}
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!
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:
Seems to be linked to the assembly, but I'm not really aware of what's going on.
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.
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();
});
}
}
Publish a nuget package so we can include the package in our projects.
Hey,
Just some questions on how to do things.
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.
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! :)
It would be useful to have a function that returns a snapshot of the video (Like VLC Media Player)
Hi,
what are the changes of having English comments instead of Chinese?
Hello @higankanshi. When i try to change Scale and/or AspectRatio properties during playback, they don't work as supposed to.
我修正了一下,不會造成卡住,結束時也不會發生類似#29的問題,但我好像Pull request失敗,無法給您參考
await System.Threading.Tasks.Task.Run(() =>
{
while (_stopping)
{
}
}).ContinueWith((a) =>
{
VlcMediaPlayer.Stop();
if (_context != null) _context.Dispose();
_context = null;
});
VideoSource = null;
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
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();
}
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?
Have you dropped winforms support. Does this now only work with WPF ?
hello,
It Is Possible to adjust the video filters: saturation, hue, brightness, etc ..
Thanks a lot.
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
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.
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?
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.
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.
我用wpf控件 窗体有5个视频控件 需要切换播放 每次切换需要销毁后重新创建 多次切换后 就出现 "System.AccessViolationException"
VLC Media Player has 4 options for audio stereo mode: Stereo, Left, Right, Reverse stereo. It would be nice to have them
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\" />
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 ...
新的wpf项目只需要引用xZune.Vlc.Wpf和xZune.Vlc吗?还是要引进libvlc 如何制定引用的libvlc的路径
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.
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
Hi,
is in xZune.VLc a chance to set a Volume?
Thanks for answer
Ludek
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?
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
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
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?
I may be missing something, but how can I disable the logger interface window from showing up? This also happens in Release mode.
在本地进度条可以任意拖拽,播放在线视频的时候。可以往后拖拽,却不能往前拖拽。即如果我在看第10分钟,我可以拖到10分钟以后的任意位置观看,却不能拖到10分钟以前的位置。视屏会卡掉或者直接从第10分钟继续播放,您知道是怎么回事吗?
Hello @higankanshi
Your WPF implementation of libVlc uses almost 2x CPU time of the standalone VLC application.
How can we reduce this value?
I am trying to have an exe where the libvlc is included as an embedded resource, so I do not have to copy around a bunch of files all the time, only the .exe
Can I follow this approach http://stackoverflow.com/questions/96732/embedding-one-dll-inside-another-as-an-embedded-resource-and-then-calling-it-fro and place the code to load the embedded assembly in xZune.Vlc.Wpf.VlcPlayer.cs
?
There should be a property to set playback speed. A float for example with default value of 1 ...
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();
TakeSnapshot drops with NullReferenceException in code
switch (_snapshotContext.Format)
{ ...
(file /xZune.Vlc.Wpf/VlcPlayer.cs)
Pull Request #21
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:
So, i want to play a mp4 file from a server, the server requires a cookie to be set, is that possible?
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.
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?
I have another feature request. Is it possible to integrate a stretch to display the video with different stretch options?
https://msdn.microsoft.com/de-de/library/system.windows.media.stretch(v=vs.110).aspx
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.