|
|
Hey there,
I'm using the Windows Media Encoder SDK to run an web application that streams a user's desktop. When I run the application in debug mode, it works perfectly; when I run it outside of debug mode (http://localhost instead of http://localhost:1234/folder/file.aspx) it streams a blank page.
Has anyone experienced this issue, or have any ideas on how to remedy it?
Thanks in advance,
Robby
|
|
On Tue, 19 Jun 2007 12:35:54 -0700, robbyking[ at ]gmail.com wrote:
[Quoted Text] >Hey there, > >I'm using the Windows Media Encoder SDK to run an web application that >streams a user's desktop. When I run the application in debug mode, it >works perfectly; when I run it outside of debug mode ( http://localhost>instead of http://localhost:1234/folder/file.aspx) it streams a blank >page. >
I don't know what you mean by "debug mode" in that context.
The only difference between your posted examples is the port number used to access the web server - which has no relation to the media encoder activeX control (even if you're using one).
Since you haven't posted your page code, it's impossible to answer.
Cheers - Neil ------------------------------------------------ Digital Media MVP : 2004-2007 http://mvp.support.microsoft.com/mvpfaqs
|
|
|
[Quoted Text] > I don't know what you mean by "debug mode" in that context.
To clarify...
I'm using Visual Studio.NET to develop, and when I launch the app in debug mode in VS, it works fine...when I run it though IIS, I get a blank (black) stream.
Thanks...
|
|
And the code, if that helps:
WMEncoderApp EncoderApp = new WMEncoderApp(); IWMEncoder Encoder = EncoderApp.Encoder; Encoder.AutoIndex = true;
IWMEncSourceGroupCollection SrcGrpColl = Encoder.SourceGroupCollection; IWMEncSourceGroup SrcGrp = SrcGrpColl.Add("SG_1"); IWMEncVideoSource2 SrcVid = (IWMEncVideoSource2)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO); IWMEncSource SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
SrcAud.SetInput("Default_Audio_Device", "Device", "");
SrcVid.SetInput("ScreenCapture1", "ScreenCap", ""); IWMEncProfileCollection ProColl = Encoder.ProfileCollection; IWMEncProfile Pro;
ProColl = Encoder.ProfileCollection; int lLength = ProColl.Count;
for (int i = 0; i <= lLength - 1; i++) { Pro = ProColl.Item(i); if (Pro.Name == "Screen Video/Audio High (CBR)") { SrcGrp.set_Profile((IWMEncProfile)Pro); break; } }
// Create a broadcast. IWMEncBroadcast BrdCst = Encoder.Broadcast; BrdCst.set_PortNumber(WMENC_BROADCAST_PROTOCOL.WMENC_PROTOCOL_HTTP, Port);
// Start the encoding process. Encoder.PrepareToEncode(true); Encoder.Start();
StartEncodingButton.Visible = false; StopEncodingButton.Visible = true;
noteMessageLabel.Text = "The encoding stream was successfully started. You can view the stream at <a href='mms://" + ComputerName + ":" + Port + "'><u>mms://" + ComputerName + ":" + Port + "</u></a>";
|
|
On Wed, 20 Jun 2007 06:42:30 -0700, robbyking[ at ]gmail.com wrote:
[Quoted Text] >> I don't know what you mean by "debug mode" in that context. > >To clarify... > >I'm using Visual Studio.NET to develop, and when I launch the app in >debug mode in VS, it works fine...when I run it though IIS, I get a >blank (black) stream.
Sounds like a permissions problem to me. Does the IIS process have access to the directory containing the profiles ? That would normally be C:\Program Files\Windows Media Components\Encoder\Profiles
IIS should *not* have access to that part of the filesystem, and there's probably the root of your problem.
You should probably try instead WMEncProfile2.LoadFromFile or perhaps LoadFromMemory with an in-memory stream (so you can keep the profile in a secure area of the web root)
Cheers - Neil ------------------------------------------------ Digital Media MVP : 2004-2007 http://mvp.support.microsoft.com/mvpfaqs
|
|
Thanks Neil...I think this is the problem, though I'm still experiencing the issue.
I created a profile and added it to a new folder, C:\Inetpub\wwwroot \EncodingProfiles\;
I then changed the part of my code that gets the profile to...
IWMEncProfile2 Pro = new WMEncProfile2(); SrcVid.SetInput("ScreenCap://ScreenCapture1", "ScreenCap", ""); Pro.LoadFromFile([ at ]"C:\Inetpub\wwwroot\EncodingProfiles \casscade.prx"); SrcGrp.set_Profile((IWMEncProfile)Pro);
Now, again, it's working through VS.NET's debug mode, but not directly through IIS. To try to pinpoint the issue, I temporarily gave IUSR, IWAM, and ASPNET full control over the folderthe EncodingProfiles folder, but didn't have any luck.
I still think this is a permissions, error, though; the encoding bitrate and resolution do not match the profile's.
Have any ideas as to who needs what additional permissions?
And thanks again, Neil, you've been a huge help.
|
|
Oh, hang on - screen capture ? Think about the user context...
Now try to do that with another capture source (any random hardware or a file source). It could well be that the IIS server process has no idea how to "interact with the desktop", so I'd like to revise my possible diagnosis ;-)
Cheers - Neil
On Thu, 21 Jun 2007 08:32:02 -0700, robbyking[ at ]gmail.com wrote:
[Quoted Text] >Thanks Neil...I think this is the problem, though I'm still >experiencing the issue. > >I created a profile and added it to a new folder, C:\Inetpub\wwwroot >\EncodingProfiles\; > >I then changed the part of my code that gets the profile to... > > IWMEncProfile2 Pro = new WMEncProfile2(); > SrcVid.SetInput("ScreenCap://ScreenCapture1", >"ScreenCap", ""); > Pro.LoadFromFile([ at ]"C:\Inetpub\wwwroot\EncodingProfiles >\casscade.prx"); > SrcGrp.set_Profile((IWMEncProfile)Pro); > >Now, again, it's working through VS.NET's debug mode, but not directly >through IIS. To try to pinpoint the issue, I temporarily gave IUSR, >IWAM, and ASPNET full control over the folderthe EncodingProfiles >folder, but didn't have any luck. > >I still think this is a permissions, error, though; the encoding >bitrate and resolution do not match the profile's. > >Have any ideas as to who needs what additional permissions? > >And thanks again, Neil, you've been a huge help. > > > > >
------------------------------------------------ Digital Media MVP : 2004-2007 http://mvp.support.microsoft.com/mvpfaqs
|
|
In case you're interested...
I just moved the profiles into my web root, and now they run fine (t was a permissions issue). When I have time I'm going to pinpoint exactly what wasn't able to read the other folder, but I have a deadline to meet in the meantime. :)
Thanks for pointing me in the right direction!
Robby
|
|
On Tue, 26 Jun 2007 19:24:55 -0000, robbyking[ at ]gmail.com wrote:
[Quoted Text] >In case you're interested... > >I just moved the profiles into my web root, and now they run fine (t >was a permissions issue). When I have time I'm going to pinpoint >exactly what wasn't able to read the other folder, but I have a >deadline to meet in the meantime. :) > >Thanks for pointing me in the right direction!
Right-o.
The more I think about it though, the more it seems being able to run screen capture under a web server process is a security hole - rather like being able to open a mic on the server and broadcast the room audio from the server room would be ;-)
Cheers - Neil ------------------------------------------------ Digital Media MVP : 2004-2007 http://mvp.support.microsoft.com/mvpfaqs
|
|
On Tue, 26 Jun 2007 21:07:41 GMT, Neil Smith [MVP Digital Media] wrote:
[Quoted Text] > The more I think about it though, the more it seems being able to run > screen capture under a web server process is a security hole - rather > like being able to open a mic on the server and broadcast the room > audio from the server room would be ;-)
<deafening scream of cooling fans> ;-)
-- http://www.chrisnet.net/code.htm [MS MVP for DirectShow / MediaFoundation]
|
|
Sir,
I am developing an application were i need to stream live images to other end , but i am getting an delay of 5 -6 secs using windows media encoder .I need to remove this delay how can this be done i could not found any resource for it on net . ***************************************************** Image transfer application has two parts
1. server side application 2. client side application
1. server side application:
Download the media encoder 9 series and media encoder SDK 9 series first and run those controls and add the path into vc++ directories. Now copy the profile named “myprofile†attached into the c:\program files \ windows media components\encoder\profiles and add the “encoderempl†class attached you’re your application and write following code to crate and play encoder.
CEncoderImpl EncoderImpl; // create object into .h
EncoderImpl.CreateEnc();// call into .cpp EncoderImpl.StartEncoder();
2. client side application:
On the client side application add a media player 4 active x control and make an object of control class and set the url first and then called the play function. Find the client side application attached.
Here m_MediaPlayer is member variable created through class wizard
CString str("http://"); // can use mms protocol str+="192.168.1.111"; // change the system ip or can give the system name str+=":8080";
m_MediaPlayer.SetUrl(str); m_MediaPlayer.GetControls().play();
************************************************** This is the fragment how i amtrying to do it.
I hope you can help me out.
Regards
Naveen
"Neil Smith [MVP Digital Media]" wrote:
[Quoted Text] > On Tue, 19 Jun 2007 12:35:54 -0700, robbyking[ at ]gmail.com wrote: > > >Hey there, > > > >I'm using the Windows Media Encoder SDK to run an web application that > >streams a user's desktop. When I run the application in debug mode, it > >works perfectly; when I run it outside of debug mode ( http://localhost> >instead of http://localhost:1234/folder/file.aspx) it streams a blank > >page. > > > > > I don't know what you mean by "debug mode" in that context. > > The only difference between your posted examples is the port number > used to access the web server - which has no relation to the media > encoder activeX control (even if you're using one). > > Since you haven't posted your page code, it's impossible to answer. > > Cheers - Neil > ------------------------------------------------ > Digital Media MVP : 2004-2007 > http://mvp.support.microsoft.com/mvpfaqs>
|
|
On Tue, 26 Jun 2007 23:19:38 -0400, "Chris P." <msdn[ at ]chrisnet.net> wrote:
[Quoted Text] >On Tue, 26 Jun 2007 21:07:41 GMT, Neil Smith [MVP Digital Media] wrote: > >> The more I think about it though, the more it seems being able to run >> screen capture under a web server process is a security hole - rather >> like being able to open a mic on the server and broadcast the room >> audio from the server room would be ;-) > ><deafening scream of cooling fans> ;-)
OK, it's a fair point - security by obscurity LOL
Cheers - Neil ------------------------------------------------ Digital Media MVP : 2004-2007 http://mvp.support.microsoft.com/mvpfaqs
|
|
|