473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Help with Windows Media SDK 9

Hi,

I want to convert an .mpeg to a .wmv file.

//Creating an Encoder object
WMEncoder Encoder = new WMEncoder();

//Create a Source Collection Group
IWMEncSourceGroupCollection SrcGrpColl =
Encoder.SourceGroupCollection;

//Adding a source to the SrcGrpColl
IWMEncSourceGroup SrcGrp = SrcGrpColl.Add("SG_1");

//Adding video to the Source Group
IWMEncVideoSource2 SrcVid = (IWMEncVideoSource2)
SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);
SrcVid.SetInput(source,"","");

//Specifying where to save the video file
IWMEncFile File = Encoder.File;
File.LocalFileName = ("c:\\output.wmv");

//Starting Encoding
Encoder.PrepareToEncode(true);
Encoder.Start();
Console.WriteLine("Press Enter when the file has been encoded");
Console.ReadLine();
}

That is the code that I have partially written and borrowed from the
SDK code samples. I am encoutering an error at Encoder.Start()

Could anyone suggest anything.

Thanks
Nov 16 '05 #1
3 4454
Hi Satya,

What kind of error do you get?

Michel

sa***@uky.edu (priya) wrote in message news:<e4*************************@posting.google.c om>...
Hi,

I want to convert an .mpeg to a .wmv file.

//Creating an Encoder object
WMEncoder Encoder = new WMEncoder();

//Create a Source Collection Group
IWMEncSourceGroupCollection SrcGrpColl =
Encoder.SourceGroupCollection;

//Adding a source to the SrcGrpColl
IWMEncSourceGroup SrcGrp = SrcGrpColl.Add("SG_1");

//Adding video to the Source Group
IWMEncVideoSource2 SrcVid = (IWMEncVideoSource2)
SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);
SrcVid.SetInput(source,"","");

//Specifying where to save the video file
IWMEncFile File = Encoder.File;
File.LocalFileName = ("c:\\output.wmv");

//Starting Encoding
Encoder.PrepareToEncode(true);
Encoder.Start();
Console.WriteLine("Press Enter when the file has been encoded");
Console.ReadLine();
}

That is the code that I have partially written and borrowed from the
SDK code samples. I am encoutering an error at Encoder.Start()

Could anyone suggest anything.

Thanks

Nov 16 '05 #2
Hi Michel,

The error I get is at Encoder.Start and it is
System.Runtime.InteropServices.ComException.

I tried the C# samples in the SDK too, the very first one converting a
.mpg to .wmv doesnt seem to work.

I have no clue on how to approach the problem.

Thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3
Hi Michel,

The problem is that if I try to convert an mpeg it just converts
hardly a frame and if I try to convert any other file type it says
that the ClassFactory cannot supply the requested class.

Thanks!
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Philip Korolev | last post by:
Hi All. I am looking for articles on Windows Media development in ASP.NET pages. Dynamically adding playlists etc. Can I use server side code or is it all client side controlled? Spent the last...
1
by: dlarsson | last post by:
Music CD experts: So, here's my problem. I burned (or tried to burn) my first audio or music CD on my computer using Windows Media Player. I "Rip-ed" the tracks from a source CD and...
1
by: Lonewolf | last post by:
Hi everyone, pls forgive me for my lack of knowledge and skills if my question sounds very stupid. I am trying to implement a video conferencing software and I am currently looking at a few set of...
1
by: Stephen Adam | last post by:
Hi there, Have spent a while trying to find out how to connect to Windows Media Player through COM. Unfortunately there doesnt seem to be much stuff about it on the web. What I need to do is...
1
by: Silverton Mike | last post by:
I need to retrieve Windows Media Player playlists programmatically via C# from a desktop machine. Does WMP keep track of used/created playlists via registry entries or a saved file on the hard...
8
by: Lloyd Sheen | last post by:
I have a problem with persisting the state of a control. It has several properties that can be determined but there is no event to indicate when the property changes. A postback occurs when one...
9
by: Morris Neuman | last post by:
Im working with VS 2005 and trying to use a Hyperlink field in a datagrid to play a wave file that is not located in the website folders but is in a plain folder on the same machine, windows 2003...
4
by: hzgt9b | last post by:
Using VS 2003, VB.NET and/or ASP.NET 2.0, BACKGROUND I have a window forms based application that contains a TreeView control and a WebBroswer (AxSHDocVw.AxWebBrowser) control. The TreeView is...
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
0
by: cw808 | last post by:
Hi all. I'm new here but hoping I can get some help for my problem. My situation is that I need to upload files through a C# .NET web application to a file server. I done a search and followed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.