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 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

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

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.

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.

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();
                });
            }
        }

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! :)

Take snapshot of video

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

comments

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

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;

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

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();
        }

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?

Winforms support

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

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

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.

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?

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.

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.

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

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\" />

.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 ...

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

Change Volume

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

Thanks for answer
Ludek

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?

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

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

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?

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.

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

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

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?

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

Playback speed

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

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();

Snapshot creation error

TakeSnapshot drops with NullReferenceException in code

switch (_snapshotContext.Format)
                { ...

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

Pull Request #21

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: 

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?

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.

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?

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.

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.

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.