I have a C# desktop application that needs to play video files.
I am currently using the WMPlib, along with Interop.WMPLib and AxInterop.WMPLib.
Using this I can play WMV videos, but I need to be able to play more formats, such as MKV, MP4, AVI, OGV and MOV.
Digging through MSDN I found a comment that said that it only supported the "default codecs", but didn't specify which ones they were... I can't seem to find a list of the supported codecs for this lib online either..
How can I implement multiple format playing? Am I even able to do it? The documentation for this isn't exactly very clear and my googling only got me this far..
thanks in advance!
VLC is a media player that can play just about any unencrypted audio/video file. You can use its functionality as a library in .NET, e.g. with libvlcSharp.
Related
I've searched without any luck about how this can be done in C#. What i'm trying to archieve is a program that accepts video files and converts them to H.264. Here is an example of a page where you can do this interactively:
http://www.ofoct.com/video-converter/convert-to-h-264-video.html
Question:
How can I in .NET create a program that can do something similar to whats being done from that homepage I shared? Any help or input is highly appreciated, thanks!
EDIT:
The reason i want to do this is because it seems like videos play in both iOS and Android devices when this is done, perhapps there is another way to make sure videos can play in both iOS and Android?
EDIT again:
Lets say i film a Video on a phone Android/iOS, now I'm using a ASP.NET web api that I'd like to convert theese movies to H.264 before storing in Azure, Is this possible? If so, any pointers on how?
There is a wrapper available http://www.ffmpeg-csharp.com/
The main point is that no one is going to write an encoder due to how slow it would be in .NET
Encoding/decoding are provided by the OS, through Direct Show (in the past) or Microsoft Media Foundation. For example, the Microsoft Media Foundation already contains a [H.264 Video Encoder](H.264 Video Encoder).
The SDK is appropriate for C++ and Microsoft hasn't released a wrapper. There are wrapper projects available though, eg. MF.Net, DirectShow.NET, WindowsMedia.NET although it doesn't have any activity since 2012.
There are also similar questions in StackOverflow, that propose other options, like using Microsoft's Encoder, although H.264 support is available only in the Pro version
The only plausable way would be to call out to an encoding application such as ffmpeg.
I'm not sure that this what you need but you can download a nuget called
NR.VideoConverter :> then you can write this code to convert the type of video
like from mp4 to mvo or anything I'm not sure what is h264 but I did find it when I wanted to change my videos so it could help y
var converter = new NReco.VideoConverter.FFMpegConverter();
converter.ConvertMedia(FilePath, FilePath, NReco.VideoConverter.Format.h264);
I have a desktop application (mfc) in which now I have to implement split and merge of MP4 videos. I have searched a lot and found almost nothing online. Please help me with some hints on how to proceed and what to use. Splitting and merging should be done on timeline basis and not based on size. Code is in VC++
Can I achieve this with Windows Video Encoder? If yes, how to know about the exposed methods in WME?
DirectShow (now part of Windows SDK) provides editing services (EDS) but I would suggest ffmpeg (http://ffmpeg.zeranoe.com/builds/) as a better choice since it would support wider range of formats (e.g. H.264 - http://msdn.microsoft.com/en-us/library/windows/desktop/dd390353(v=vs.85).aspx).
Is it possible to capture video and audio in Silverlight5 and save it as movie in any video format?
Silverlight 5 can automatically detect video and audio capture devices, which you can open operations on using the System.Windows.Media.CaptureDeviceConfiguration class and associated classes.
http://chris.59north.com/post/Audio-recording-and-encoding-in-Silverlight.aspx has info on how to use those classes to save the audio to a Stream (as well as compressing it), which you can then save to disk.
http://www.dotnetfunda.com/articles/article1751-how-to-access-a-video-and-snap-a-picture-from-webcam-in-silverlight.aspx has similar info on how to access video and save images from webcams on to disk using Silverlight.
Pro Silverlight 5 in C# (excerpt on Google Books) has more information on how to do this.
I have been doing quite a lot of searching and I have yet to find any samples of anyone actually saving video. The best I have been able to come up with is saving a sequence of images. That doesn't really sound like a good solution
A project I am currently working on at work requires the ability to convert videos from other formats to the WMV format. We need to be able to convert virtually any video format that is commonly used to a WMV format. I am looking for a solution allot like On2's flix engine converts other video types to .flv videos. I am aware of the encoder that windows offers, but it has a very limited list of video types that it can convert from. Please let me know if you have any suggestions or opinions, or recommendation of software I can use to do this. I need to be able to do the conversions in batch and I need to be able to do them programmatically with C#.
Have you had a look at ffmpeg?
It seems to be at the core of many open source video conversion utilities, so I imagine you could use it in the scenario you describe.
SUPER, the name is really covering the load!
Well, first you have to be able to decode the file format. You need to set this up with directshow, which is very hard to work with. You can take a look at the mediaportal project for a directshow file player written in C#. Instead of using the video renderer at the end of the directshow graph, you would reencode the video and audio and mux them into a .wmv file. This is a very involved project to get right. You essentially have to mimic a player's ability to play any format and handle failure.
I've been very satisfied using Quick Media Converter.
I'm looking at options for adding streaming video to a social web site written in ASP.NET/C#. I have a great deal of experience with Flash too, so I'm comfortable using FLV players, but I'd definitely go Silverlight if the right library is available.
The library would need to be able to encode user uploaded video in a web format.
I imagine playback will be Flash or Silverlight based.
It would need to create thumbnails of the video.
It would need to have server software for streaming the video or have some 3rd party way of doing so.
I don't mind paying a licensing fee for the software, so it does not have to be open source or free.
The license must allow use on a commercial web site.
The closest thing I have found is MediaSoft's offering. But I never heard of this company before starting my search and don't know anyone using their software. They seem to be using FFMPEG to perform encoding, which I heard can spawn legal issues for commercial web sites. Though I'm not very familiar with the licensing of FFMPEG myself so please correct me if I heard wrong.
Has anyone used MediaSoft? Any other video libraries that you have used that worked well? Did you just end up writing your own video encoding and serving library?
Not sure about Silverlight, but Flash will render both h.264 and FLV videos. FFMPEG can convert into both via liblame for FLV and x264 for h.264. It can also generate thumbnails.
It and the corresponding modules are licensed under the LGPL/GPL which means you can use FFMPEG to generate videos/thumbnails without restriction as long as you have the rights to the original movies that you're transcoding. The GPL/LGPL license restrictions only apply to the FFMPEG code/binaries which won't matter until you decide to distribute those binaries to other people.
In addition to the above answer, you can look at red5 as a streaming solution
http://osflash.org/red5