Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 25th, 2006, 07:36 AM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello. I have same aim like Saban. And i installed WM Encoder 9 SDK. Found Example to broadcast video stream in MSDN:

The following example shows how to create the predefined user interface, and broadcast live multimedia content from the local computer (http://computer_name:8080). The audio and video sources are configured to use the default sound card and video capture card.

using System;
using WMEncoderLib;
class EncodeFile
{
    static void Main()
    {
        try
        {
            // Create WMEncoderApp and WMEncoder objects.
            WMEncoderApp EncoderApp = new WMEncoderApp();
            IWMEncoder Encoder = EncoderApp.Encoder;

            // Display the predefined Encoder UI.
            EncoderApp.Visible = true;

            // Specify the source for the input stream.
            IWMEncSourceGroupCollection SrcGrpColl = Encoder.SourceGroupCollection;
            IWMEncSourceGroup SrcGrp = SrcGrpColl.Add("SG_1");
            IWMEncSource SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
            IWMEncVideoSource2 SrcVid = (IWMEncVideoSource2)SrcGrp.AddSource(WMENC_SOURCE_ TYPE.WMENC_VIDEO);
            SrcAud.SetInput("Default_Audio_Device", "Device", "");
            SrcVid.SetInput("Default_Video_Device", "Device", "");

            // Specify a profile.
            IWMEncProfile Pro;
            IWMEncProfileCollection ProColl = Encoder.ProfileCollection;

            for (int i = 0; i < ProColl.Count; i++)
            {
                Pro = ProColl.Item(i);
                if (Pro.Name == "Windows Media Video 8 for Local Area Network (384 Kbps)")
                {
                    SrcGrp.set_Profile(Pro);
                    break;
                }
            }

            // Create a broadcast.
            IWMEncBroadcast BrdCst = Encoder.Broadcast;
            BrdCst.set_PortNumber (WMENC_BROADCAST_PROTOCOL.WMENC_PROTOCOL_HTTP, 8080);

            // Start the encoding process.
            Encoder.PrepareToEncode(true);
            Encoder.Start();

            // Use this statement so that the Windows Media Encoder window does not close until you press Enter.
            Console.WriteLine("Press Enter to close this window.");
            Console.ReadLine();
        }

        catch (Exception e)
        {
            // TODO: Handle exceptions.
        }
    }
}
but in the "WMEncoderApp EncoderApp = new WMEncoderApp();" string I have exception:
Retrieving the COM class factory for component with CLSID {632B606B-BBC6-11D2-A329-006097C4E476} failed due to the following error: 80040154
Pls tell who know what is this...
Saban, please tell me how u solved u'r problem...
If not to use this string and remake code for capture devices
(SrcVid.SetInput("ScreenCapture1", "ScreenCap", "");)
i have another exception in the "Encoder.PrepareToEncode(true);" string about illegal video format.


 
Old April 29th, 2006, 11:43 PM
Authorized User
 
Join Date: Nov 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes I was having problems finding a suitable way to stream my desktop images. The application I built using Windows Media Encoder runs fine. I am pushing my stream to a windows media server unlike what you are trying to achieve i.e. broadcasting from the local machine itself. Have you decoded the error code? And have you installed windows media Encoder in your machine? I'm not sure but from the exception you mentioned it seems there is problem with your Windows Media Encoder. Please check.

 
Old April 30th, 2006, 06:40 AM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thx. I found by error code many articles, but there was descreibed codec problems. I didn't thought that besides SDK I have to Install WM Encoder (=. Sorry. And now i can broadcast video screen capture. But capturing+encoding procces takes 100% my CPU. )=
Anyway my problem solved by installing WM Encoder (about 10mb).

 
Old May 6th, 2006, 12:21 AM
Registered User
 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi sabansingh!

    I used the "broadcast video stream in MSDN" examples in ASP.NET application. here i got the following error,

The system cannot find the file specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: The system cannot find the file specified.

plz help me about this error.

How to Use WMEncoder in ASP.NET?

Plz give ur ideas ASAP.


 
Old May 7th, 2006, 12:05 AM
Authorized User
 
Join Date: Nov 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Ganesh,
Could you paste the code that u used if its not a problem. It might help in finding the error.

Saban.







Similar Threads
Thread Thread Starter Forum Replies Last Post
To minimize the CPU Utilization on DB server Scorpio1 J2EE 0 January 22nd, 2008 02:59 AM
how to calculate bandwidth debuajm C# 2005 0 January 16th, 2007 07:40 AM
Bandwidth Control or Limiting using JSP draggy Pro JSP 3 July 21st, 2006 02:58 PM
CPU utilization:Thread Pooling Bom VS.NET 2002/2003 1 October 11th, 2003 01:03 PM
CPU utilization:Thread Pooling Bom VS.NET 2002/2003 0 October 8th, 2003 08:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.