Quantcast
Channel: VideoLan DotNet for WinForm, WPF
Viewing all 471 articles
Browse latest View live

New Post: How to dump raw RTSP stream to file?

$
0
0
Is it possible to dump a raw RTSP stream to file and then later decode the file to something playable?
I would like to save the stream to file without decoding it and play this file from different position

Is this possible?

New Post: Crash in VlcContext.CloseAll() -- FreeLibrary

$
0
0
Hello,

VlcContext.CloseAll() crashes on my system in a piece of code that was added in the last release (I think). I use VLC 64 bits (portable installation) on Win 7, from C# (.NET 4.0) in WinForms.
Videos play fine, the only problem is on dispose.

see https://vlcdotnet.codeplex.com/workitem/7743

My code:
VlcContext.LibVlcDllsPath = config.VlcPath;
VlcContext.LibVlcPluginsPath = config.VlcPluginsPath;
VlcContext.StartupOptions.IgnoreConfig = true;
VlcContext.StartupOptions.LogOptions.LogInFile = true;
VlcContext.StartupOptions.LogOptions.ShowLoggerConsole = false;
VlcContext.StartupOptions.LogOptions.Verbosity = VlcLogVerbosities.Debug;
VlcContext.Initialize();

MediaBase media = new PathMedia(file.Path);
MediaTrackInfo trackInfo = media.TrackInfos.First(ti => ti.Type == Vlc.DotNet.Core.Interops.Signatures.LibVlc.Media.TrackTypes.Video);
VlcContext.CloseAll();
If I comment the "MediaTrackInfo" line, it doesn't crash on dispose. The crash occurs in LibVlcInteropsManager.cs line 138:
Win32Interop.FreeLibrary(module.BaseAddress);
This line is executed around 10 times successfully but when it tries to unload "libdash_plugin.dll", crash. From the error code it looks like an access violation.

Problem Event Name: APPCRASH
Application Name: --
Application Version: 10.0.30319.1
Application Timestamp: 4ba2084b
Fault Module Name: ntdll.dll
Fault Module Version: 6.1.7601.18247
Fault Module Timestamp: 521eaf24
Exception Code: c0000005
Exception Offset: 0000000000018cb5
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 4105
Additional Information 1: 450c
Additional Information 2: 450c04f07fa1f815a2cedf864b3efd43
Additional Information 3: 6536
Additional Information 4: 6536c1a78ae88e5ea8021416daf05c84

Any idea? Thanks for your help!

New Post: Play RTSP Stream

$
0
0
Hello,

I have a Rtsp Server on another PC in my LAN streaming a file.
the path for the stream is "rtsp://192.168.30.11/MyVideo.mkv".

Two things I want to be able to do:
  1. be able to access this stream an Play the video.
  2. Also, save the stream into a video file, and save the video file to my disk.
    the file is encoded in H264 (RTP payload type 96).
I looked at the source code but didn't find any examples about how to do it when the stream in from another computer.

Thanks!

New Comment on "Wpf"

$
0
0
A functioning code example would be great. Please.

New Post: getting exception when creating video file

$
0
0
Hello,
I have a project where I get H264 stream from a server.
the stream is exposed under the URL "rtsp://localhost/live/Testing" (vlc can play it, so the path is fine).

I an trying to save the stream into a video file, but I get exception - "cannot set up option while media is not initialized yet".

Here is the code:
private void StoreFile()
{
Vlc.DotNet.Core.Medias.MediaBase media1
= new Vlc.DotNet.Core.Medias.PathMedia("rtsp://localhost/live/Testing");

media.AddOption(":sout=#transcode{vcodec=theo,vb=800,
scale=1,acodec=flac,ab=128,channels=2,samplerate=44100}:std{access=file,mux=ogg,
dst=D:\\123.mp4}");

VlcControl control = new VlcControl();
control.Media = media1;
control.Play();
}
any help?

New Post: WPF application with 8 simultaneous video streams

$
0
0
I have a WPF application that displays eight H264 camera video streams simultaneously. I used the control and almost all is perfect.

I am having a problem when I start running the application, sometimes the application starts awkwardly (the videos are not fluid as if they had very low FPS, I can not interact with the UI thread smoothly, etc ...). Sometimes when I start running, everything is smoothly with no delays in the videos, UI thread responds instantly, etc... About 80% of the times the application starts perfect.

I have no idea what it may be, I've done several tests, such as starting the videos from different threads or even delaying a second time between the start of the videos, without success.

I am using the following properties:
VlcContext.StartupOptions.AddOption("--no-video-title-show");
VlcContext.StartupOptions.AddOption("--ffmpeg-hw");
VlcContext.StartupOptions.AddOption("--network-caching=300");

I wish I could solve the problem, or else I wish I could detect when it happens to reset the application without the user interaction.

Unfortunately, I don't know how to detect the problem as showing the console I have not seen anything relevant, and if I try to access the FPS control property always returns 0.

Any help will be appreciated!

Thank you

PD: The computer is a Intel Core i7 with 8GB of RAM.
The CPU is around 37%

New Post: FYI : Freezes when calling Stop()

$
0
0
First of all, thanks for these controls (in my case WinForms control)...

Please note that I just began using your control so the problem below might be in my code...

I have noticed some problems with freezes (or is it called "hangs"?) when I call the Stop()-method sometimes. My program just hangs during the shut down process, at the Stop()-call, and does not quit (within the first few seconds, haven't waited any longer, cause I am impatient :-) ) so I stop the program with Visual Studios stop-button...
  1. When I change the audio to be silent, either by setting IsMute to true, or by setting Volume to 0, freezes seem to happen almost every time (well, keep on reading) when I call Stop()...
        vlcControl1.AudioProperties.IsMute = true;
        vlcControl1.AudioProperties.Volume = 0;
    
  2. I accidentally noticed that if I call Application.DoEvents() right before my call to Stop(), there seem to be no freezes...even if I mute the sound as I mentioned above, there seem to be no freeze...
Is there a bug here related to the order of events (possibly connected to the AudioProperties class and Stop()-method) that causes the freezes that I used to get all the time?

Either way, it works for me now, so do whatever you want with the information :-)

/Per

New Post: Video brightness

$
0
0
After a user asked me by contact form if i found a solution:

Im using: PowerMPlayer

http://sourceforge.net/projects/powermplayer/

Seek in videos is much faster than with vlc. Less crashes. Brightness/contrast and more....

MPlayer.SendSlaveCommand(SlaveCommandMode.None, "brightness " + value + " 1");

New Post: VideoLan DotNet SetHwnd

$
0
0
I am currently working with a WPF application using VideoLan DotNet. VideoLan DotNet seems to be using a couple of callbacks and writes the output to memory. I am trying to convert the library to use the SetHwnd function and have VLC draw the images directly.

I removed these two lines
VlcContext.InteropManager.MediaPlayerInterops.VideoInterops.SetFormatCallbacks.Invoke(VlcContext.HandleManager.MediaPlayerHandles[this], myVideoSetFormat, myVideoCleanup);
VlcContext.InteropManager.MediaPlayerInterops.VideoInterops.SetCallbacks.Invoke(VlcContext.HandleManager.MediaPlayerHandles[this], myVideoLockCallback, myVideoUnlockCallback, null, IntPtr.Zero);
Then I added a function to call SetHwnd
public void SetHwnd(IntPtr windowHandle)
{
 VlcContext.InteropManager.MediaPlayerInterops.SetHwnd.Invoke(VlcContext.HandleManager.MediaPlayerHandles[this], windowHandle);
}
This doesn't seem to work. It never starts drawing to the window handle provided. I feel like I am missing something small, but I cant seem to find it.

New Post: VLC.DotNet windows Control Hosted in WPF

$
0
0
Are you still working on this? I was trying this myself but at this point I get audio, but no video. I would definitely be willing to help take a look, but I need to get it up and running this way.

New Post: Crash in VlcContext.CloseAll() -- FreeLibrary

$
0
0
Same problem here.
Did you have a solution?

New Post: Crash in VlcContext.CloseAll() -- FreeLibrary

$
0
0
Yes, I think it's a bug in VLC itself and not vlcdotnet. The bug is only in VLC 64 bits version 2.1.5 (latest).
My solution is to downgrade to version 2.1.4. You could also use a more recent (nightly/unstable) build of VLC.

New Post: Crash in VlcContext.CloseAll() -- FreeLibrary

$
0
0
In fact, I just checked and they updated the official 2.1.5 build last week to fix this bug. So just download the new 2.1.5 and it should work.

Here is the info about the bug in their bug tracking system: https://trac.videolan.org/vlc/ticket/11793

New Post: Crash in VlcContext.CloseAll() -- FreeLibrary

$
0
0
Hi, mlessard33!
I forgot to call vlcControl.Close() on FormClosing event.
I did it and all is working.

Anyway I'll update VLC.

Thank you.

Reviewed: VideoLan DotNet for WinForm, WPF, SL5 - 2014.04.18 (Oct 01, 2014)

$
0
0
Rated 5 Stars (out of 5) - Just what I was looking for, I needed a similar project and the outdated libvlc.net isn't really the optimal solution. This is the most hassle free solution I was able to find. It also works great, although the documentation is a thing that can be worked on.

Updated Wiki: Home

$
0
0

Project Description

The VlcDotNet libraries provide the audio/video control of the VLC Media Player for Windows Forms, WPF, and Silverlight 5. Now you can stream audio and video in C# and VB.NET!

You can see how to use it on the Documentation page.

image image

Format Compatibility 

VlcDotNet has the same compatibility as VLC Media Player. See here for the list of supported formats.

News

The new version is available here.

April 18, 2014:

  • The new version adds and corrects many features :
    • Correction : #7743 - Not all DLLs unloaded on Dispose
    • Correction : #7687 - PInvokeStackImbalance with .NET 4
    • Correction : Difference between source and release

April 19, 2012:

  • I'm focusing on the WinForm control and I'm working on a new implementation for it which:
    • Doesn't need to invoke the UI thread on each Vlc action and events
    • Can now provide long action on Vlc media position changed event (next same event will be synchronize with the current position)
    • Will provide the new implementation of logging with the future Vlc versions
    • More stability
    • ...
  • If you have any requests on the Winform control, feel free to let me know
  • Also, for documentations and samples, I'm looking for some screenshots of POC with Vlc.DotNet
  • Many thanks for your help!

Nov 22, 2011:

  • The new version contains Silverlight 5 library: Vlc.DotNet.Silverlight. A sample could be tested here
  • The new version adds and corrects many features :
    • Correction : Reinitialize some variables
    • Deprecate : Logging API, since VLC 1.2 (08/20/2011)
    • Add subitem in LocationMedia (for Youtube videos, ...)
    • Update Wpf sample to use Youtube videos
    • Many others corrections

July 20, 2011:

  • Change in MediaBase class :
    • Removed 'Media' prefix on events
    • Added Metadatas
    • Changed TrackInfos properties
  • Fixed freeze on stop
  • Fixed Memory leaks for Wpf control
  • Added ErrorHandling
  • Few fixes

June 29, 2011:

  • Few bugfixes and memory leak fixes available on latest source code (no new version for the moment)

May 17, 2011:

  • A lot of additions and corrections... View changes on download page.

May 11, 2011:

  • Correction : WPF application crash/stop bug
  • Correction : WPF OutOfMemory due to BitmapSource
  • WPF Sample : Viewport3D sample :-)

May 10, 2011:

  • Add Audio Introps for media player
  • Add AudioProperties to VlcControl :
    • IsMute
    • Volume
    • Delay
  • Add VideoProperties to VlcControl :
    • Size
    • Scale
  • Correction : Error on retrieving Vlc version
  • Correction: Change Vlc function "libvlc_set_exit_handler" to be only available with Vlc 1.2

May 09, 2011:

May 06 2011:

  • The new version will be available next Monday!

April 19 2011:

  • Hi everybody, I've got a very good news... After few months of work on different projects, I'm resuming the VideoLan DotNet project. And the bestnews is that the new WPF and also the WinForm, controls work very well. But be patient...
  • Changes since last version :
  •  
    • Rewrote source (yet another time :-) 
    • Bug correction of AccessViolationexception on Winform 
    • Bug correction of "MDA Warning" 
    • Removed password of assembly signing key 
    • Why not a In-memory snapshot 
    • Compatibility with all verions of videolan >= 1.1.0  
    • Enable to define the libvlc.dll / libvlccore.dll and plugins directories. They could be on different locations and also in the default vlc directory. 
    • Enabled overlay for WPF control
  • If you have any suggestions, I could put them in the future version. I think I'll put my current dev. version in the beginning of May, so I'll need some people to test this version when I put it on codeplex.

Don't worry, be happy for the next version :) 

Participation

  • I am looking for a helper to develop with me, so if you would like to participate, send patches or join me.
  • I'm looking for a logo for Vlc.DotNet, so if you have some time to create one, send me it.

Updated Wiki: Home

$
0
0

Project Description

The VlcDotNet libraries provide the audio/video control of the VLC Media Player for Windows Forms, WPF, and Silverlight 5. Now you can stream audio and video in C# and VB.NET!

You can see how to use it on the Documentation page.

image image

Format Compatibility 

VlcDotNet has the same compatibility as VLC Media Player. See here for the list of supported formats.

News

The new version is available here.

April 18, 2014:

  • The new version adds and corrects many features :
    • Correction : #7743 - Not all DLLs unloaded on Dispose
    • Correction : #7687 - PInvokeStackImbalance with .NET 4
    • Correction : Difference between source and release

April 19, 2012:

  • I'm focusing on the WinForms control and I'm working on a new implementation for it which:
    • Doesn't need to invoke the UI thread on each Vlc action and events
    • Can now provide long action on Vlc media position changed event (next same event will be synchronize with the current position)
    • Will provide the new implementation of logging with the future Vlc versions
    • More stability
    • ...
  • If you have any requests on the WinForms control, feel free to let me know
  • Also, for documentations and samples, I'm looking for some screenshots of POC with Vlc.DotNet
  • Many thanks for your help!

Nov 22, 2011:

  • The new version contains Silverlight 5 library: Vlc.DotNet.Silverlight. A sample could be tested here
  • The new version adds and corrects many features :
    • Correction : Reinitialize some variables
    • Deprecate : Logging API, since VLC 1.2 (08/20/2011)
    • Add subitem in LocationMedia (for Youtube videos, ...)
    • Update WPF sample to use Youtube videos
    • Many others corrections

July 20, 2011:

  • Change in MediaBase class :
    • Removed 'Media' prefix on events
    • Added Metadatas
    • Changed TrackInfos properties
  • Fixed freeze on stop
  • Fixed Memory leaks for WPF control
  • Added ErrorHandling
  • Few fixes

June 29, 2011:

  • Few bugfixes and memory leak fixes available on latest source code (no new version for the moment)

May 17, 2011:

  • A lot of additions and corrections... View changes on download page.

May 11, 2011:

  • Correction : WPF application crash/stop bug
  • Correction : WPF OutOfMemory due to BitmapSource
  • WPF Sample : Viewport3D sample :-)

May 10, 2011:

  • Add Audio Introps for media player
  • Add AudioProperties to VlcControl :
    • IsMute
    • Volume
    • Delay
  • Add VideoProperties to VlcControl :
    • Size
    • Scale
  • Correction : Error on retrieving Vlc version
  • Correction: Change in the Vlc function "libvlc_set_exit_handler" to be only available with Vlc 1.2

May 09, 2011:

May 06 2011:

  • The new version will be available next Monday!

April 19 2011:

  • Hi everybody, I've got a very good news... After few months of work on different projects, I'm resuming the VideoLan DotNet project. And the bestnews is that the new WPF and also the WinForm, controls work very well. But be patient...
  • Changes since last version :
  •  
    • Rewrote source (yet another time :-) 
    • Bug correction of AccessViolationexception on Winform 
    • Bug correction of "MDA Warning" 
    • Removed password of assembly signing key 
    • Why not a In-memory snapshot 
    • Compatibility with all verions of videolan >= 1.1.0  
    • Enable to define the libvlc.dll / libvlccore.dll and plugins directories. They could be on different locations and also in the default vlc directory. 
    • Enabled overlay for WPF control
  • If you have any suggestions, I could put them in the future version. I think I'll put my current dev. version in the beginning of May, so I'll need some people to test this version when I put it on codeplex.

Don't worry, be happy for the next version :) 

Participation

  • I am looking for a helper to develop with me, so if you would like to participate, send patches or join me.
  • I'm looking for a logo for Vlc.DotNet, so if you have some time to create one, send me it.

Updated Wiki: Documentation

$
0
0

To start a project with Vlc.DotNet, download & install VLC media player. You don’t need to add the files (libvlc.dll, libvlccore.dll) in the output compilation directory, you have to set the "VlcContext.LibVlcDllsPath" property , "VlcContext.LibVlcPluginsPath" property of the VlcContext and initialize it.
See : C# Form example & Wpf example.


To use the WPF control you must use the nightly build of VideoLan because you must use version >= 1.2 of it and it hasn't rolled out of production yet.

 

New documentation is now in progress, should be up soon.

Updated Wiki: Forms

$
0
0

Vlc.DotNet.Forms : The WinForms control

This is the audio/video control for winform 2.0.

First of all, you must initialize the VlcContext before loading a VlcControl on your form or code:

 

Code Snippet
  1. [STAThread]
  2. static void Main()
  3. {
  4.     Application.EnableVisualStyles();
  5.     Application.SetCompatibleTextRenderingDefault(false);
  6.  
  7.     //Set libvlc.dll and libvlccore.dll directory path
  8.     VlcContext.LibVlcDllsPath =CommonStrings.LIBVLC_DLLS_PATH_DEFAULT_VALUE_AMD64;
  9.     //Set the vlc plugins directory path
  10.     VlcContext.LibVlcPluginsPath =CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_AMD64;
  11.  
  12.     //Set the startup options
  13.     VlcContext.StartupOptions.IgnoreConfig =true;
  14.     VlcContext.StartupOptions.LogOptions.LogInFile =true;
  15.     VlcContext.StartupOptions.LogOptions.ShowLoggerConsole =true;
  16.     VlcContext.StartupOptions.LogOptions.Verbosity =VlcLogOptions.Verbosities.Debug;
  17.  
  18.     //Initialize the VlcContext
  19.     VlcContext.Initialize();
  20.  
  21.     Application.Run(newForm1());
  22.  
  23.     //Close the VlcContext
  24.     VlcContext.CloseAll();
  25. }

After that, you can use the VlcControl with designer or by code.

As you can see, you must also close the VlcContext when the application closes.

Updated Wiki: Forms

$
0
0

Vlc.DotNet.Forms : The WinForms control

This is the audio/video control for WinForms 2.0.

First of all, you must initialize the VlcContext before loading a VlcControl on your form or code:

 

Code Snippet
  1. [STAThread]
  2. static void Main()
  3. {
  4.     Application.EnableVisualStyles();
  5.     Application.SetCompatibleTextRenderingDefault(false);
  6.  
  7.     //Set libvlc.dll and libvlccore.dll directory path
  8.     VlcContext.LibVlcDllsPath =CommonStrings.LIBVLC_DLLS_PATH_DEFAULT_VALUE_AMD64;
  9.     //Set the vlc plugins directory path
  10.     VlcContext.LibVlcPluginsPath =CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_AMD64;
  11.  
  12.     //Set the startup options
  13.     VlcContext.StartupOptions.IgnoreConfig =true;
  14.     VlcContext.StartupOptions.LogOptions.LogInFile =true;
  15.     VlcContext.StartupOptions.LogOptions.ShowLoggerConsole =true;
  16.     VlcContext.StartupOptions.LogOptions.Verbosity =VlcLogOptions.Verbosities.Debug;
  17.  
  18.     //Initialize the VlcContext
  19.     VlcContext.Initialize();
  20.  
  21.     Application.Run(newForm1());
  22.  
  23.     //Close the VlcContext
  24.     VlcContext.CloseAll();
  25. }

After that, you can use the VlcControl with designer or by code.

As you can see, you must also close the VlcContext when the application closes.

Viewing all 471 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>