Choose audio stream in Media Element - c#

We're creating a video player in WPF using .NET 4.0. For this purpose we are using MediaElement. For videos with multiple audio streams, we have MediaElement.AudioStreamIndex property in Silverlight and Windows Store apps. But I didn't find any similar property in WPF. Am I missing something? What's the best way to implement such functionality in WPF?

Related

Windows Phone 8 - Playing streamed audio (internet radio station)

I am trying to make an application that would play an audio stream (mp3) from the following URL http://icecast6.play.cz/radio1-128.mp3. I am struggling to get it working. Is there any default support for cases like these? That the content is continuously streamed?
I have tried to use Background Audio Agent and set Media Element but none of that has been working for me. Would Background Audio Streamer be an option for me? I would be happy for any similar example that I would use to my advantage.
Thank you
I found phonesm project on codeplex that provides great examples and functionality for implementing internet audio streaming.
You need to use BackgroundAudioPlayer by creating another project and adding its reference to your project.
Check this link:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202978%28v=vs.105%29.aspx
You can use Microsoft player framework.
For more details Player Framework

H.264 stream in WPF GUI

I am developing a Window7, C#/WPF based GUI and I want to show H.264 video which I get from the RTP stream of a video call. I am using a C based open source library for making the video call. This is what I want to implement: The user dials a URI by typing in the address and pressing the call button and when the video call is established the H.264 stream is seen in the WPF GUI window.
Does the latest WPF support H.264? If not, what other windows based framework/technology can I use to show H.264 video on Windows 7?
Yes, WPF VideoElement can show H264, if you have latest windows media player installed(I think windows7 has WMP installed by default).
If that doesn't benefit you, you can always use MediaKit that can do everything: http://wpfmediakit.codeplex.com/ (you can feed your own DirectShow graph to VideoElement by registering new protocol - basically means anything is possible this way)

Axis Camera video streaming with C# 64bit

I'm looking for a way to stream video from an AXIS M10 IP camera, and display the feed using windows forms (or better, wpf). However, it need to be running on 64-bit platform.
This means that I can't use the AXIS Media Control ActiveX component.
Also, I found that these methods work but only in 32bit environment:
1.Using MediaElement Class for WPF
2.Using embedded media player
3.VlcLib (for dotnet)
So far it looks like my only option is to directly implement RTSP protocol and decode the given RTP/AVP stream using Media Foundation (for .net) and display it somehow. (I was able to get the camera to stream to a UDP port using RTSP calls).
I'm fairly new to RTSP/streaming, so I'm concerned that I might be missing the big picture - Will I be able to use media foundation to render/display videos on winform/wpf, or do I have to look at that functionality elsewhere?(from my research it looked like it could decode H.264 streams, but I did not see any video-playing capabilities). I also came across DirectShow - should I use DirectShow over Media Foundation?
Or better yet, is there a library that is able to handle RTSP streaming that runs in 64bit?
VisioForge Video Capture SDK .Net for example (but commercial), WPF controls included.
Decoding using FFMPEG, with DirectShow engine. Really, I don't see any Media Foundation advantages here.
Also any other way using FFMPEG.
Or, you can write RTSP source filter (based on DirectShow Push Source sample) with H264 output pin for video and G726/G711/AAC for audio. Also you can made virtual video capture source filter and use it in MF or DirectShow. You can use live555 library for RTSP implementation.
So, no simple ways here, if you are starting from zero.
If you just need the Video, I would prefer to just display the MJPEG stream of the camera. This is really easy done without the complexity of DirectShow or MediaFoundation. I display 12 cameras at the same time in my application with this little library in WPF: MJPEG Decoder. You can also use it in WinForms. It decodes the MJPEG Stream and gives you the images to display.
The 64 bits Axis Media Control SDK is available now, but requires an account on Axis web site to be downloaded.
After Sign in, you need to join Axis Developper program (free) and download the AMC SDK.
You will install a executable file (.exe), this install all the libs and samples in your Drive
C:\Program Files\Axis Communication\SDK
I found a way to use VLC in 64bits without ActiveX DLL :
The VLCSharp Library is composed of multiple NuGets to use VLC Player on severals platforms (WPF, Winforms, Xamarion, TvOS).
It is working fine on Onvif Cameras

H264 -> Container using .NET

I have raw H264 video data that I want to wrap into some kind of container format so that I can play it in a video player like WMP or VLC, and I want to do this in .NET (C#), or C++. What is the easiest approach? Does anyone know of a free/open source SDK that would make this easy?
You can simply play it through a WPF media element if the computer has the appropriate Codec's installed.

What options do I have on Winforms Video playback using .net 2.0

what options do I have for video playback in my .net c# windows application.
currently I am playing with "Microsoft.DirectX.AudioVideoPlayback" but this has, if I am not mistaken, a pre-requirement that DirectX be loaded on the computer.
are there any other options?
UPDATE:
I am using winforms .net 2.
Not sure what display technology you are using (WPF or WinForms), but take a look at the WPF MediaElement. It abstracts everything for you and plays really well.
If you are using WinForms, you can still embed the WPF MediaElement inside the WinForms if it makes sense for you.

Categories

Resources