[C#] Chromecast stream from local IP camera

This forum is about all development around libVLC.
Bakineo
New Cone
New Cone
Posts: 3
Joined: 10 Dec 2019 15:09
Operating System: Windows Linux macOS

[C#] Chromecast stream from local IP camera

Postby Bakineo » 10 Dec 2019 17:39

Hello !

I want to get a live stream from my local IP camera on a chromecast through a C# application.
I didn't succeed to do that with libVLCsharp, I only found a sample for Android and iOS but my application is for Windows (not Windows Phone)

Can anybody tell me how can I do please ?

Thanks in advance !

mfkl
Developer
Developer
Posts: 740
Joined: 13 Jun 2017 10:41

Re: [C#] Chromecast stream from local IP camera

Postby mfkl » 11 Dec 2019 03:17

Hi,

What have you tried? Can you share your code?

It should work the same way as the Android sample.
https://mfkl.github.io

Bakineo
New Cone
New Cone
Posts: 3
Joined: 10 Dec 2019 15:09
Operating System: Windows Linux macOS

Re: [C#] Chromecast stream from local IP camera

Postby Bakineo » 11 Dec 2019 11:12

Hi,

I tried to implement the libVLCsharp's chromecast sample ( https://code.videolan.org/mfkl/libvlcsharp-samples/tree/master/Chromecast/Chromecast )
My code is in a windows form (stream on chromecast when I click on the "Button_DIFFUSER" button)
The error is https://imgur.com/mVb6wtN but the dll files are here...

Code: Select all

public partial class Form_MAIN : Form { readonly HashSet<RendererItem> _rendererItems = new HashSet<RendererItem>(); LibVLC _libVLC; MediaPlayer _mediaPlayer; RendererDiscoverer _rendererDiscoverer; private async void Button_DIFFUSER_ClickAsync(object sender, EventArgs e) { try { DiscoverChromecasts(); await Task.Delay(2000); StartCasting(); } catch(Exception err) { MessageBox.Show("erreur : "+err); } } private void StartCasting() { if(!_rendererItems.Any()) { MessageBox.Show("No renderer items found. Abort casting..."); return; } var media = new Media(_libVLC, "axrtsp://192.168.1.221/axis-media/media.amp", FromType.FromLocation); _mediaPlayer = new MediaPlayer(_libVLC); _mediaPlayer.SetRenderer(_rendererItems.First()); _mediaPlayer.Play(media); } bool DiscoverChromecasts() { Core.Initialize(); _libVLC = new LibVLC(); RendererDescription renderer; renderer = _libVLC.RendererList.FirstOrDefault(r => r.Name.Equals("microdns_renderer")); _rendererDiscoverer = new RendererDiscoverer(_libVLC, renderer.Name); _rendererDiscoverer.ItemAdded += RendererDiscoverer_ItemAdded; return _rendererDiscoverer.Start(); } void RendererDiscoverer_ItemAdded(object sender, RendererDiscovererItemAddedEventArgs e) { MessageBox.Show($"New item discovered: {e.RendererItem.Name} of type {e.RendererItem.Type}"); if(e.RendererItem.CanRenderVideo) MessageBox.Show("Can render video"); if(e.RendererItem.CanRenderAudio) MessageBox.Show("Can render audio"); _rendererItems.Add(e.RendererItem); } }

mfkl
Developer
Developer
Posts: 740
Joined: 13 Jun 2017 10:41

Re: [C#] Chromecast stream from local IP camera

Postby mfkl » 12 Dec 2019 04:27

Share your full code in a git repository
https://mfkl.github.io

Bakineo
New Cone
New Cone
Posts: 3
Joined: 10 Dec 2019 15:09
Operating System: Windows Linux macOS

Re: [C#] Chromecast stream from local IP camera

Postby Bakineo » 12 Dec 2019 09:45

Hi,

Here the Form_REPLAY.cs file : https://gitlab.com/Obvie/vlc-chromecast/blob/master/Form_REPLAY.cs
I don't think I can share the full code because it's for work

Thank you !

mfkl
Developer
Developer
Posts: 740
Joined: 13 Jun 2017 10:41

Re: [C#] Chromecast stream from local IP camera

Postby mfkl » 16 Dec 2019 04:08

Can you stream it with the official VLC apps?
Can you share some logs?
https://mfkl.github.io


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 14 guests