I'm wondering what the best way is to play back an MP4 video in a Windows Forms application (.NET 2.0) on Vista and XP.
You could Embed Windows Media Player on a Form.
UPDATE: WMP doesn't support MP4 out-of-the-box, but there are codecs packs that add such support. It's possible to bundle a codec installation with your setup, but I think WMP is able to fetch and install MP4 codec on its own.
Either embedding media player or look at managed DirectX (although MDX is a bit old now)
take a look at iSpy - it's open source and wraps VLC player for mp4 playback.
http://www.ispyconnect.com
Related
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
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 :)
I am writing a Windows Phone application with ability to play video. I have found a lot of custom video players, but I want to find out, is there a standard video player in Windows Phone and what I need to do for using it?
http://msdn.microsoft.com/en-us/library/ff769551(v=VS.92).aspx
The MediaElement is the standard control for playing video files in WP7 apps.
You can use default media player with the help of MediaElement and MediaPlayerLauncher.
You can play local videos and urls with video.
I hope this link will help you
*http://www.developer.nokia.com/Community/Wiki/Video_Playback_with_MediaElement*
I want to add a video player in my Windows Form that would be able to stream videos (flv) from internet (web-server). So far i've tried Microsoft Windows Media Player and it's working but I don't like it because of its lags and bugs and etc.
So are there any other video players that can be easily embedded in a Windows Form and that support video streaming? (by streaming I don't mean something like live TV streaming, but just downloading (buffering) and playing at the same time the video)
Perhaps you can embed VLC as an ActiveX component?
There is a Flash ActiveX control which (I expect) would handle these natively.
I am working on one of the media project (windows application). In this the flv, avi and mpeg are the main file types which i have to play in application. I can use wmpLib, but it will not play flv files. So what procedure should i follow and what tools or libraries should i use.Is there any free opensource libraries to do media work. Thanks in advance
Also you can use ffmpeg lib see here, I think it would be easy to convert to another format using that for playback I don't really know, maybe you can take a look at the source of vlc or take a look at some flv opensourced player around.
If you have the right direct show filters installed media player will play flv files.