Axis Camera video streaming with C# 64bit - c#

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

Related

C# Streaming from Panasonic IP camera using RTSP

I want to receive an RTSP stream from a Panasonic camera (Model WV-SPN531) and display the live video in my C# Form application.
If I use VLC and connect to "rtsp://IP_ADDRESS/MediaInput/h264/stream_1" the streaming works fine.
Codec: H264 - MPEG-4 AVC (part10) (h264)
Resolution: 1920x1080 (15 FPS)
I have tried this library, but it does not work: http://net7mma.codeplex.com/ .
I wrote to the developer of the library and I described the problem and he replied that: "There's not an available MPEG decoder in C# right now, not one which I know of immediately anyway."
Can you help me?
I have used this SDK to play RTSP video in C#
https://sourceforge.net/projects/onvifdm/files/%21sample_winform/
It uses a hosted executable to play the video but works very well
I also tested https://github.com/ZeBobo5/Vlc.DotNet before hand but the performance was a bit choppy compared with the above.
I am using the Datastead Rtsp source SDK to capture Panasonic, Axis and some other IP cameras.

Effective video stream compression in C#

I am looking for a effective way to compress a real time video stream. In my project, the streaming seems important because my system will send and receive both the audio and video streams at the same time. I am considering using H261 or H263. How can I achieve such compression ratio using C#?
PS I found something called H323Plus, but I do not know how to call this library because it is written in C++.
If you want to do real-time streaming over UDP with both audio and video stream you can use the DirectShow API (if you're targeting Windows).
http://msdn.microsoft.com/en-us/library/windows/desktop/dd375454(v=vs.85).aspx
You will find a .NET wrapper for DirectShow here
http://directshownet.sourceforge.net/
You will also find more samples on codeproject.com, most of them use this wrapper
http://www.codeproject.com/kb/audio-video/#DirectShow
If you plan on targeting Windows 7 and newer only, then you will want to use Windows Media Foundation API
http://msdn.microsoft.com/en-us/library/windows/desktop/ms694197(v=vs.85).aspx

Make MediaElement support more video codecs

Is there a way to make MediaElement support more video codecs like mkv, flv, mov etc.? If not, is there any other control that supports more video codecs?
Have you seen the Player Framework?
It's an open source component supporting Windows 8, part of the Microsoft Media Platform, and developed by Microsoft.
It's an alternative to the standard MediaElement control, and provides a plug-in mechanism.
I'm not sure whether you can support extra codecs through this mechanism though.
Other than that, you can also extend the media platform (the extension has to be written in C++ though) as shown in these samples provided by Microsoft:
Media Extension Sample
MediaStreamSource media extension sample
The second example is very interesting as it's a sample media extension adding the MediaStreamSource mechanism as in Silverlight.
Thanks to this extension you could implement your own MediaStreamSource in C#/VB.NET providing content to the MediaElement.
It seems impossible as WinRT has completely different set of API and all existing win32 based codecs won't run unless codec owners rewrite them. One long way will be to port win32 code into winrt which will require in depth knowledge of both and seems way too long to do it. Even if somehow you will find way to make existing codec work, it will not work on arm based windows 8 tablets.
This means, there are no codecs for winrt other then Microsoft has provided.
Your options are to convert them into h.264 video, which has become a standard as h.264 plays on all devices. Apple did great job by standardizing video. Win 7 onwards, microsoft has provided inbuilt support for h.264.
MediaElement plays whatever the windows media player can play.
So if you have the right set of codecs installed on your PC it can be a pretty versatile media player.
Personally I have installed K-Lite codecs
As well as Media_player_codec_pack codecs
And now my Windows Media Player doesn't lag anymore when playing mp4 files. Just follow the suggestion of the installer and restart your PC BEFORE starting the installation process. Also... it attempts to trick you with dialogs to install secondary software so BEWARE!!
Once Installed, just remember to experiment with the "preferred acceleration" parameter in the application's video settings, to see what goes better according to your hardware. I have set it to - CUVID.
I also installed this set of codecs to support avi format
Hope this helps :)

How do I encode an image in H.263 and send it in real time using udp

I am building a sip softphone in C#, I am through with the audio aspect, but I want to add video call capability to it, I can successfully get image from the webcamera on the system, but the problem now is I want to compress the image using h.263 codec algorithm before sending it over udp in realtime, all the codes I have been seeing on h.263 is in c++, and I am not a C++ person, please how can I implement this in C#, I mean get the video from the webcamera, encode in h263 and send it over wire in realtime, any suggestion will be highly appreciated
If you want to do real-time streaming over UDP with both audio and video stream you can use the DirectShow API (if you're targeting Windows computers). Official documentation available here: http://msdn.microsoft.com/en-us/library/windows/desktop/dd375454(v=vs.85).aspx
You will find a .NET wrapper for DirectShow here: http://directshownet.sourceforge.net/ and also some samples.
You will also find more samples on codeproject.com, most of them use this wrapper: http://www.codeproject.com/kb/audio-video/#DirectShow
Using DirectShow you will be able to capture both the webcam and the microphone in realtime, encode them using the appropriate encoder filter (for instance, a h263 encoder for the video stream) and then send the encoded frames over the network using a RTSP writer filter.
I'm not an expert on DirectShow, but this could be a good starting point. I know this solution works because I've implemented it few months ago.
You need to know that DirectShow is beeing deprecated since Windows Vista, and is beeing replaced by the new API: Windows Media Foundation. If you're targeting Windows Vista or Windows 7 only, it may be a better choice to use the new API. See the MSDN documentation for more details: http://msdn.microsoft.com/en-us/library/windows/desktop/ms694197(v=vs.85).aspx
Hope this will help you.

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.

Categories

Resources