Skip to main content
Home Forums Silverlight Design Video and Media convert all video formats to .wmv in C#
2 replies. Latest Post by MayurGondaliya on September 5, 2009.
(0)
newbie06
Member
0 points
4 Posts
08-20-2009 4:18 PM |
What encoder can I use to convert any video format that is uploaded by the user to a .wmv video format? I would like to use the upload control and C# plus and encoder to accomplish this.
Jonathan...
All-Star
24939 points
2,425 Posts
08-26-2009 7:23 AM |
Hi Newbie06,
We need to use the Expression Encoder API to encode the upload video files.
1: using (LiveJob job = new LiveJob())
2: {
3: // Create a new file source from the file name we were passed in
4: LiveFileSource fileSource = job.AddFileSource(fileToEncode);
5:
6: fileSource.PlaybackMode = FileSourcePlaybackMode.Loop;
7:
8: //Alternatively, enumerate a capture device (not shown here)
9:
10: job.ActivateSource(fileSource);
11:
12: WindowsMediaBroadcastOutputFormat outputFormat = new WindowsMediaBroadcastOutputFormat();
13:
14: // Let's broadcast on the local machine on port 8080
15: outputFormat.BroadcastPort = 8080;
16:
17: // Set the output format on the job
18: job.OutputFormat = outputFormat;
19:
20: // Start encoding
21: Console.Out.Write("Press 'x' to stop encoding...");
22: job.StartEncoding();
23:
24: while (Console.ReadKey(true).Key != ConsoleKey.X)
25: {
26: // We are waiting for the 'x' key
27: }
28:
29: // Stop our encoding
30: Console.Out.WriteLine("Encoding stopped.");
31: job.StopEncoding();
32: }
See this link: http://blogs.msdn.com/expressionencoder/archive/2009/07/10/9828866.aspx
Best regards,
Jonathan
MayurGon...
4 points
2 Posts
09-05-2009 5:17 PM |
Can you confirm that the below SDK is needed for the conversion to WMV, please? I am new to this at the moment.
http://www.microsoft.com/downloads/details.aspx?FamilyId=9A077A3D-58CE-454C-B486-153F0578BE4A&displaylang=en