video conversion in C# - c#

Iam writing an application which will do Conversion from AVI to MPEG, WMV to AVI, WMV to MPEG or H.264/AVC video, AVI to MP4, RMVB to 3GP, etc.
I am looking for C# code and tutorials for the same.
Any pointers will be really helpful.

If you are fine with using ffmpeg, you may want to look at answers to this question.

You can use DirectShow, see here, google with directshow for other conversions

As Rohit mentioned use and download ffmpeg.exe from here
I have used it several times and made conversion, 2 pass filtering, created frames, preview images.

Related

Playing videos in a C# desktop application

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.

Conversion from avi to wmv

I would like to make an avi to wmv convertor on my own. For this, my understanding is I'd study the internal structure of an avi file and extract frame by frame and put in the way wmv encodes the frames. I would like to draw suggestions for learning the pattern of wmv. Is there any online documentation for a layman.
Hi Windows SDK is your best friend:
Learn Windows: Audio and Video Development
Microsoft Windows
Software Development Kit
Edit:
find more info about WMV here: http://en.wikipedia.org/wiki/Windows_Media_Video
Here you can find the WMV/ASF specifications:
Advanced Systems Format (ASF) Specification

Avi to Mpeg conversion with using C#

Yes i want to convert avi file to mpeg file..This will be first experience for me..I am so newbie at this..Is converting avi to mpeg possible with using C#.
If yes,what i have to do? Which article i have to read?
This is a quite complicated topic that you'll want to relegate to a 3rd party component. The most widely used tool is ffmpeg which you can call from c# by launching it as a child process.
http://www.ffmpeg.org/
FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video.
Due to licensing restrictions it's generally not available as a binary download--you'll need to download source and compile it yourself.

Audio Conversion C#

What is the best way to convert various audio formats to PCM?
For example: mp3, evrc, ogg vox.
Is there a library out there that will allow me to implement this relatively easily?
EDIT:
I guess my initial question wasn't really what I needed. Most of the libs I have found are file converters. What I need is a block converter, where I pass in a 1Kb block of vox data and it returns its converted PCM block. Of course I’ll have to tell the converter what type of data it is and various pieces of codec information.
The solution I am going for is to save and VOIP formats into a common wav format and to play that conformed file in real time. I thought there should be an easy way to do this because all audio is eventually turned into PCM before it is outputted anyways.
You can use NAudio to pass blocks of compressed audio into any ACM codecs you have installed on your machine. You do need to know how to create the appropriate WAVEFORMAT structure to describe the compressed audio type correctly though.
Check out AVBlocks SDK for .NET. It supports several audio formats, and audio transforms like Multi-channel audio to Stereo audio, resampling and bitrate conversion.
Try modified code from http://alvas.net/alvas.audio,tips.aspx#tip91
static void AnyToWav(string fileName)
{
DsReader dr = new DsReader(fileName);
IntPtr formatPcm = dr.ReadFormat();
byte[] dataPcm = dr.ReadData();
dr.Close();
WaveWriter ww = new WaveWriter(File.Create(fileName + ".wav"), AudioCompressionManager.FormatBytes(formatPcm));
ww.WriteData(formatPcm);
ww.Close();
}
Don't know any lib that does it all but we do mp3->wav using madxlib.
It's free but I suggest paying the $10 for the sdk as it comes with documentation and examples.
There is a c# tutorial on youtube that might be helpful to you. It shows how to use a specific audio library called alvas.audio that really does some neat things with audio. I found the video to be very educational. The audio library is completely written in c#. Watch the video for more details: http://www.youtube.com/watch?v=2DIQECXFPeU

Video Conversion to WMV

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.

Categories

Resources