LibVLCSharp issueshttps://code.videolan.org/videolan/LibVLCSharp/-/issues2022-03-01T02:41:52Zhttps://code.videolan.org/videolan/LibVLCSharp/-/issues/122Raise event user callbacks from different thread2022-03-01T02:41:52ZMartin FinkelRaise event user callbacks from different threadhttps://forum.videolan.org/viewtopic.php?t=106174https://forum.videolan.org/viewtopic.php?t=106174LibVLCSharp 4Martin FinkelMartin Finkelhttps://code.videolan.org/videolan/LibVLCSharp/-/issues/37Use Microsoft.Extensions.Logging for logging2021-08-11T09:19:06ZMartin FinkelUse Microsoft.Extensions.Logging for logging- replace `Debug.WriteLine` by `Trace.WriteLine`
- start logging more things to help the developer use LibVLCSharp and troubleshoot his code- replace `Debug.WriteLine` by `Trace.WriteLine`
- start logging more things to help the developer use LibVLCSharp and troubleshoot his codeLogginghttps://code.videolan.org/videolan/LibVLCSharp/-/issues/25Unload native libraries2020-06-24T15:39:05ZMartin FinkelUnload native librariesSomething like `Core.Deinitialize()`
- Crossplatform (what about Android JniOnLoad/iOS .framework/etc?)
- Prevent calling `Core.Initialize()` multiple times (currently this case is not covered)
/cc @jeremyVignelles Something like `Core.Deinitialize()`
- Crossplatform (what about Android JniOnLoad/iOS .framework/etc?)
- Prevent calling `Core.Initialize()` multiple times (currently this case is not covered)
/cc @jeremyVignelles LibVLCSharp 4https://code.videolan.org/videolan/LibVLCSharp/-/issues/521Consider overriding WinForms' CreateHandle/DestroyHandle2021-11-24T02:15:05ZJérémy VIGNELLESConsider overriding WinForms' CreateHandle/DestroyHandleThe WinForms control currently makes use of `ISupportInitialize` to attach the media player's HWND, but there are a few drawbacks:
- An empty BeginInit() method, just because it's an interface implementation
- Doesn't call Detach() when...The WinForms control currently makes use of `ISupportInitialize` to attach the media player's HWND, but there are a few drawbacks:
- An empty BeginInit() method, just because it's an interface implementation
- Doesn't call Detach() when the control is destroyed
I've just came through these methods, and I'm wondering if that could help us:
- https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.control.createhandle?view=windowsdesktop-6.0
- https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.control.destroyhandle?view=windowsdesktop-6.0
The suggested change could look like this:
```cs
protected override void CreateHandle()
{
base.CreateHandle();
Attach();
}
protected override void DestroyHandle()
{
Detach();
base.DestroyHandle();
}
```
What do you think ?https://code.videolan.org/videolan/LibVLCSharp/-/issues/498Make EnsureVersionsMatch configurable2021-08-25T06:40:15ZMartin FinkelMake EnsureVersionsMatch configurableShould default to true but would be useful to have it configurable, for testing purposes.Should default to true but would be useful to have it configurable, for testing purposes.https://code.videolan.org/videolan/LibVLCSharp/-/issues/454Add MSIX support2023-05-19T08:35:37ZFranck EAdd MSIX supportPackaging with MSIX - WPF - LibVLCSharp.Shared.VLCException: 'Failed to load required native libraries
RE StackOverflow question [here](https://stackoverflow.com/questions/66935123/c-sharp-wpf-vlc-libvlcsharp-shared-vlcexception-failed-...Packaging with MSIX - WPF - LibVLCSharp.Shared.VLCException: 'Failed to load required native libraries
RE StackOverflow question [here](https://stackoverflow.com/questions/66935123/c-sharp-wpf-vlc-libvlcsharp-shared-vlcexception-failed-to-load-required-na/66936116?noredirect=1#comment118328158_66936116)
I am using with minimal sample, which I then prepare for the Windows store following official documentation [here](https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/modernize-wpf-tutorial-5)
Issue is that the libvlc folder is not being copied to AppX\... folder.
Minimal project included, and to make the solution small, packages are not installed. List of required packages:
LibVLCSharp.3.5.0
LibVLCSharp.WPF.3.5.0
VideoLAN.LibVLC.Windows.3.0.12
The other packages should only be dependencies.
[vlc-msix-app.zip](/uploads/00ae31e9ffc15bcf6bc8e1223e011c4e/vlc-msix-app.zip)https://code.videolan.org/videolan/LibVLCSharp/-/issues/449Add more precise timer for progress bar scenarios2021-05-25T07:26:30ZMartin FinkelAdd more precise timer for progress bar scenarios### Problem to solve
Some users request a more stable/precise progress bar.
libvlcsharp could offer some doc, a sample and/or an helper to facilitate this.
### Intended users
Anyone who wants finer time based data.
### Proposal
htt...### Problem to solve
Some users request a more stable/precise progress bar.
libvlcsharp could offer some doc, a sample and/or an helper to facilitate this.
### Intended users
Anyone who wants finer time based data.
### Proposal
https://github.com/videolan/vlc/blob/0090bfdc2647ae2a4f003617ab5c411c17ce7db7/src/player/timer.c#L474
### Documentationhttps://code.videolan.org/videolan/LibVLCSharp/-/issues/448UWP LibVLCSharp.Shared.VLCException: Could not create Direct3D11 device : No ...2021-12-27T11:48:46ZSurameUWP LibVLCSharp.Shared.VLCException: Could not create Direct3D11 device : No compatible adapter found### Summary
Unable to initialize the lvs:VideoView control included in the LibVLCSharp.Platforms.UWP lib on non-directx compatible computers.
On the same machine the VLC UWP application works correctly.
<!-- Summarize the bug encount...### Summary
Unable to initialize the lvs:VideoView control included in the LibVLCSharp.Platforms.UWP lib on non-directx compatible computers.
On the same machine the VLC UWP application works correctly.
<!-- Summarize the bug encountered concisely -->
The lvs:VideoView control raise an exception during the InitializeComponent() sub.
"
Exception thrown: 'SharpDX.SharpDXException' in SharpDX.dll
Exception thrown: 'SharpDX.SharpDXException' in SharpDX.dll
Exception thrown: 'SharpDX.SharpDXException' in SharpDX.dll
Exception thrown: 'LibVLCSharp.Shared.VLCException' in LibVLCSharp.dll
Exception thrown: 'LibVLCSharp.Shared.VLCException' in LibVLCSharp.dll
Exception thrown at 0x00007FFBA2B9D759 (KernelBase.dll) in LibVLCSharp.UWP.Sample.exe: WinRT originate error - 0x80131500 : **'LibVLCSharp.Shared.VLCException: Could not create Direct3D11 device : No compatible adapter found.**
at LibVLCSharp.Platforms.UWP.VideoViewBase.CreateSwapChain()'.
onecore\com\combase\winrt\error\restrictederror.cpp(1016)\combase.dll!00007FFBA343C8D3: (caller: 00007FFBA34465A9) ReturnHr(1) tid(5c8) 8007007E The specified module could not be found."
**How one can reproduce the issue**
It's very easy to reproduce, you just need a virtual machine that doesn't have an advanced graphics card (without gpu/remotefx module). In my case, it is a virtual machine on Azure IaaS service. It's a virtual machine in Azure that I use to dev.
Reproducible with the UWP sample project LibVLCSharp.UWP.Sample
The bug happens when you are connected via RDP or directly connected to the admin console via vnc.
It is not dependent on the way of connecting but on the graphic card equipped
The bug occure in debug and release compile mode, with and without debugger attached
Because the VLC APPs can run on these environnement, maybe we can have expect a solution for the libvlcsharp or a way to fault back if no compatible card was found.
### Environment
* OS: Windows 10
* Version 10.0.19041.867
* Device: **Azure VM IaaS with basic graphic card**
* LibVLCSharp version 3.4.9 / VideoLan.LibVLC.UWP v3.3.1
* Visual Studio 2019https://code.videolan.org/videolan/LibVLCSharp/-/issues/443StreamMediaInput optimizations2021-03-25T09:19:49ZMartin FinkelStreamMediaInput optimizations### Problem to solve
Improve StreamMediaInput performance.
### Intended users
People who need more perf when proving their own input stream to libvlcsharp.
### Proposal
- Add benchmarks like https://github.com/SixLabors/ImageSharp/b...### Problem to solve
Improve StreamMediaInput performance.
### Intended users
People who need more perf when proving their own input stream to libvlcsharp.
### Proposal
- Add benchmarks like https://github.com/SixLabors/ImageSharp/blob/master/tests/ImageSharp.Benchmarks/General/IO/BufferedStreams.cs
- Add `[MethodImpl(MethodImplOptions.AggressiveInlining)]` in a few places, like done in https://github.com/SixLabors/ImageSharp/blob/master/src/ImageSharp/IO/BufferedReadStream.cs.
- See perf numbers after that change.
### Documentationhttps://code.videolan.org/videolan/LibVLCSharp/-/issues/396Samples: netcore on macOS should create a window2020-09-09T08:02:07ZMartin FinkelSamples: netcore on macOS should create a window### Problem to solve
Currently the netcore sample app on macOS is headless. This is fine, but would be better to have some video.
libvlc cannot create a window by itself on mac, like it does on Windows.
And a netcore app requires a bit ...### Problem to solve
Currently the netcore sample app on macOS is headless. This is fine, but would be better to have some video.
libvlc cannot create a window by itself on mac, like it does on Windows.
And a netcore app requires a bit more setup than a mono app to have a cocoa window https://docs.microsoft.com/en-us/xamarin/mac/app-fundamentals/console
### Intended users
Devs for testing
netcore app users on mac.
### Proposal
improve the current sample.
### Documentationhttps://code.videolan.org/videolan/LibVLCSharp/-/issues/366Add FileInfo and StorageFile Media ctor API2020-08-13T11:58:08ZMartin FinkelAdd FileInfo and StorageFile Media ctor API### Problem to solve
Add additional helper method to create a Media.
### Intended users
Vlc.Dotnet migrating.
Any libvlcsharp user### Problem to solve
Add additional helper method to create a Media.
### Intended users
Vlc.Dotnet migrating.
Any libvlcsharp userhttps://code.videolan.org/videolan/LibVLCSharp/-/issues/359Start using PtrToStringUTF8 wherever possible2020-06-30T09:35:47ZMartin FinkelStart using PtrToStringUTF8 wherever possible### Problem to solve
Refactor existing code to use https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.marshal.ptrtostringutf8 whenever targets permit
### Intended users
libvlcsharp devs.### Problem to solve
Refactor existing code to use https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.marshal.ptrtostringutf8 whenever targets permit
### Intended users
libvlcsharp devs.https://code.videolan.org/videolan/LibVLCSharp/-/issues/345Consider using unsafe C# for perf sensitive APIs2022-02-25T06:29:14ZMartin FinkelConsider using unsafe C# for perf sensitive APIs### Problem to solve
Performance could likely be improved for LibVLC APIs that have callbacks interop.
To make sure of this, we first need to setup benchmarkdotnet and write some tests to have numbers. https://code.videolan.org/videola...### Problem to solve
Performance could likely be improved for LibVLC APIs that have callbacks interop.
To make sure of this, we first need to setup benchmarkdotnet and write some tests to have numbers. https://code.videolan.org/videolan/LibVLCSharp/-/issues/8
Only then could we be assured that it'd provide an improvement, by comparing numbers from both implementations (and by how much).
Some perf sensitive APIs I can think of:
```
libvlc_audio_set_callbacks
libvlc_media_new_callbacks
libvlc_video_set_callbacks
libvlc_video_set_format_callbacks
libvlc_video_set_output_callbacks <- especially this one
StreamMediaInput <- especially this one
```
### Intended users
All
### Proposal
Have a look on how to integrate the latest improvements from C# 9 and BCL. Would likely be a net5.0 target.
### Documentation
Samples would be a good start.https://code.videolan.org/videolan/LibVLCSharp/-/issues/328Consider adding async overload to some APIs2022-01-12T07:24:22ZMartin FinkelConsider adding async overload to some APIs### Problem to solve
- Lack of async APIs
- Some synchronous C# APIs are actually asynchronous C APIs and will return to the caller before C is done, requiring the user to subscribe to the result (and know not to trust the method return...### Problem to solve
- Lack of async APIs
- Some synchronous C# APIs are actually asynchronous C APIs and will return to the caller before C is done, requiring the user to subscribe to the result (and know not to trust the method return, and know to subscribe and how). https://code.videolan.org/videolan/LibVLCSharp/-/issues/214
### Intended users
All
### Proposal
For all mediaplayer events for example, offer async overloads in the same style as Parse.
### Documentation
Explain differences between the sync and async version.
I'm not sure whether this is _really_ needed. Opinions welcome.Martin FinkelMartin Finkelhttps://code.videolan.org/videolan/LibVLCSharp/-/issues/312Expose MediaPlayer(Media) ctor on Unity2020-04-02T09:33:23ZMartin FinkelExpose MediaPlayer(Media) ctor on Unity### Problem to solve
Expose the MediaPlayer(Media) constructor on Unity LVS builds.
### Intended users
Unity users.
### Proposal
The mediaplayer ctor is intercepted by the unity plugin and needs a libvlc instance.
We need to interna...### Problem to solve
Expose the MediaPlayer(Media) constructor on Unity LVS builds.
### Intended users
Unity users.
### Proposal
The mediaplayer ctor is intercepted by the unity plugin and needs a libvlc instance.
We need to internally expose the LibVLC instance of a Media (and remove the MediaList constructor).https://code.videolan.org/videolan/LibVLCSharp/-/issues/277CI: Enable Cake build for Linux2019-12-24T10:34:30ZMartin FinkelCI: Enable Cake build for LinuxShould work out of the box, just need to test.Should work out of the box, just need to test.https://code.videolan.org/videolan/LibVLCSharp/-/issues/276CI: Enable tvOS sample build2019-12-24T10:22:05ZMartin FinkelCI: Enable tvOS sample buildFix
```
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(646,3): error : No valid tvOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.app...Fix
```
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(646,3): error : No valid tvOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com. [/Users/runner/runners/2.163.1/work/1/s/Samples/LibVLCSharp.tvOS.Sample/LibVLCSharp.tvOS.Sample.csproj]
```
in the CI, then revert https://code.videolan.org/videolan/LibVLCSharp/commit/fcecc3d8d2a779ef68d49583a2e974caf86cad01https://code.videolan.org/videolan/LibVLCSharp/-/issues/256Use stackalloc for log callback alloc when possible2020-06-02T13:25:20ZMartin FinkelUse stackalloc for log callback alloc when possible### Problem to solve
Improve memory/perf for log callback
### Intended users
Anyone that listens to log events
### Proposal
Replace heap alloc calls by stack alloc calls when possible. Depending on process size and needed buffer siz...### Problem to solve
Improve memory/perf for log callback
### Intended users
Anyone that listens to log events
### Proposal
Replace heap alloc calls by stack alloc calls when possible. Depending on process size and needed buffer size to allocate, notably.
https://code.videolan.org/videolan/LibVLCSharp/blob/3.x/LibVLCSharp/Shared/Helpers/MarshalUtils.cs#L84
https://code.videolan.org/videolan/LibVLCSharp/blob/3.x/LibVLCSharp/Shared/Helpers/MarshalUtils.cs#L107
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/stackalloc
Would be curious to see the result of both versions with benchmarkdotnet.
### Documentation
Nonehttps://code.videolan.org/videolan/LibVLCSharp/-/issues/224Create DVD player sample2019-09-29T10:29:00ZMartin FinkelCreate DVD player sample### Problem to solve
Provide a sample code showing how to play a DVD.### Problem to solve
Provide a sample code showing how to play a DVD.https://code.videolan.org/videolan/LibVLCSharp/-/issues/215Transcoding with h264 Video Codec Fails2020-09-10T14:12:23ZTony WilkeyTranscoding with h264 Video Codec Fails### Summary
<!-- Summarize the bug encountered concisely -->
Transcoding video from an input to a file using the h264 codec fails with these error messages.
*****************
libVLC:[Error] avcodec:cannot find encoder H264 - MPEG-4 A...### Summary
<!-- Summarize the bug encountered concisely -->
Transcoding video from an input to a file using the h264 codec fails with these error messages.
*****************
libVLC:[Error] avcodec:cannot find encoder H264 - MPEG-4 AVC (part 10)
*** Your Libav/FFmpeg installation is crippled. ***
*** Please check with your Libav/FFmpeg packager. ***
*** This is NOT a VLC media player issue. ***
libVLC:[Debug] main:Buffering 13%
libVLC:[Debug] main:no encoder modules matched
libVLC:[Error] stream_out_transcode:cannot find video encoder (module:any fourcc:h264). Take a look few lines earlier to see possible reason.
*********************
<!-- How one can reproduce the issue - this is very important -->
Example repo of UWP project
https://github.com/groovykool/libVLC-Transcode.git
Press "Play".
View log box output errors
wait a few seconds press "Stop"
<!-- What actually happens -->
no transcoded output
### What is the expected *correct* behavior?
Transcoded video is saved in a file.
The transcoding options work in the VLC client.
### Relevant logs and/or screenshots
****************
libVLC:[Error] avcodec:cannot find encoder H264 - MPEG-4 AVC (part 10)
*** Your Libav/FFmpeg installation is crippled. ***
*** Please check with your Libav/FFmpeg packager. ***
*** This is NOT a VLC media player issue. ***
libVLC:[Debug] main:Buffering 13%
libVLC:[Debug] main:no encoder modules matched
libVLC:[Error] stream_out_transcode:cannot find video encoder (module:any fourcc:h264). Take a look few lines earlier to see possible reason.
*********************
### Environment
<!-- Please complete the following information. -->
- OS: Windows 10
- Version 1903
- Device: PC
- LibVLC version and architecture 3.0.4 Vetinari
- LibVLCSharp version Nuget 3.2.1
### Possible fixes
libVLC compile options?