Conversion from avi to wmv - c#

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

Related

How to convert video files to H.264 in C#

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);

Decoding .mkv (Matroska) video formats

I have a media player that I made using c# and I wanted to decode mkv formats, but I can't find any good info about the codec or how to encode/decode mkv files. How can I decode matroska (mkv) video format?
FFMPEG, VLC, DirectX (the most difficult, but probably most efficient way), and Gstreamer (my recommendation) all have .NET bindings. Take your pick.
Here is a quick link for matroska in gstreamer to get you started:

How to change the resolution of a WMV file in C#

I have a C# application and I would like to be able to read in a WMV file and then write out a WMV file with reduced resolution/quality.
Are there any built-in libraries for C# that can do this? Do I need the Windows Media Format SDK?
Does anyone have experience with this?
Can I use something like FFmpeg for this?
You will have to decode and re-encode ( = transcode) the file to do this. By doing so you will inherently reduce quality since you are working off an already compressed base.
One way to do it if you need a high degree of control is is with a DirectShow wrapper for C#, i.e. DirectShow.NET. then you just need to define a simple transcoding graph.
Actually the simplest way to do this is with Expression Encoder (the successor to Windows Media Encoder) which has a simple managed API and should do the job with much less effort than integrating DirectShow.
There's a summary article here. A simple transcoding job looks like this (sample from article, only presets changed):
MediaItem src = new MediaItem
(#"C:\WMdownloads\AdrenalineRush.wmv");
Job job = new Job();
job.MediaItems.Add(src);
job.ApplyPreset(Presets.VC1WindowsMobile);
job.OutputDirectory = #"C:\EncodedFiles";
job.Encode();
I don't think there are any classes in the .Net Framework which deal with transcoding WMV files.
But you can install the Windows Media 9 Encoder SDK and create appropriate objects in C# to do the conversion. See CodeProject.com - Convert MP3, MPEG, AVI to Windows Media Formats for a starting point. Even though that link starts with non-WMV files, the Windows Media Encoder doesn't restrict the input file format (at least when I've used the VBScript encoding batch file).
N.B If you use the WM9Encoder on Vista or Win7, you may need the hotfix - see TechNet - issues in using Windows Media Encoder 9 Series on Windows 7

video conversion in 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.

How can I create a thumbnail from an mpg video with C#?

I'd like to process a directory of mpg's in a batch to have a thumbnail using C#/.NET.
Does anyone have any good suggestions on how I could do this?
I know it's not C# .NET but ffmpeg is a great tool to do exactly this. Can be run as a command line tool from any language.
Here's a small tutorial to get you started.
I did this a few years ago, but I seem to have lost the source. Anyway, the route-of-least-resistance I found was to use DirectShow, there is an interop wrapper for managed code, namely directshow.net. You'll want to use IMediaDet's GetBitmapBits from the Windows Media Format SDK.
There is an example on CodeProject: Extract Frames from Video Files

Categories

Resources