none
capture screen and publish

    Question

  • I'm trying to use Expression Encoder 4 sp2 in a WPF app .NET to capture the screen and publish the capture via http://localhost:8080.

    Is there a way to do it? Is there an example?

    Thanks


    bruno

    Monday, April 10, 2017 8:24 PM

All replies

  • You are asking two completely separate questions, which are...

    1. Can I use the Expression Encoder SDK to capture the screen programmatically and encode it to a Web-compatible format?

    and

    2. Can I programmatically create a Web page containing a control capable displaying the encoded file?

    The answer to both is yes, since you will be working in Visual Studio. For an example of the first, see https://msdn.microsoft.com/en-us/library/gg602440(v=expression.40).aspx (scroll to "Working with Screen Capture"). There are other assets online, tutorials, etc. Google is your friend.

    As for the Web page, you have a number of options. You can use Visual Studio to create either a WebForms or an MVC solution. Or you can download the (now free) Expression Web application to produce a simple HTML page (not programmatically ;-), and EW also supports creation of ASPX pages (although not code behind) and simple data-driven applications. Simply click the "New" icon to get a complete Web page shell, then position the cursor in the blank page and click "Insert|Media|Windows Media Player." The program will ask you to point (browse) to your media file and select it. Note that browsers other than IE will require the visitor to download and install a plugin (Chrome actually says that the plugin is not supported).

    To overcome this you can use the HTML5 video player. Of course, you'll want to use a video converter to convert the wmv output to a supported format...  ;-)

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    • Edited by paladyn Tuesday, April 11, 2017 9:43 PM
    Tuesday, April 11, 2017 9:40 PM
  • From my understanding I can Capture from the screen with ScreenCaptureJob that outputs to a file, and to publish via http I need to use a LiveJob. I didn't find any way to capture the screen with a LiveJob, nor to publish with a ScreenCaptureJob.

    I tryed first to read from the output file of my ScreenCaptureJob and publish it with a LiveJob, but I had to put a certain delay between the two jobs before the output file can be processed by the LiveJob, and this is not what I need.

    I tryed this, which gave me an error:

    capJob ScreenCaptureJob;

    . . . .

    capJob.Start;

    livejob LiveJob;

    livejob.AddDeviceSource(capJob.VideoDeviceSource, ... audio..);

    publishFormat.BroadcastPort = 8080;

    liveJobPublishFormats.Add(publishFormat);

    livejob.StartEncoding

    Can you give me some details on how to do it?

    Thank you very much


    bruno

    Wednesday, April 12, 2017 10:20 AM
  • I found a solution but still not completely.

    I've installed screen-capture-recorder and I use it as a LiveDeviceSource in a LiveJob.

    Now I don't know how to set a crop area....


    bruno

    Wednesday, April 12, 2017 1:09 PM
  • I do not use the Encoder SDK myself; I use the program and its capture utility via the EE user interface. Therefore, I cannot provide you with programming assistance. I should note, however, that in the code you show above you have a syntax error in an attempt to set the value of a member of the livejob class member collection PublishFormats. In this line...

    liveJobPublishFormats.Add(publishFormat);

    ... There is no class (nor class member) named "liveJobPublishFormats." So, you need to separate the class name "livejob" from the member collection name "PublishFormats" with a period, like so...

    liveJob.PublishFormats.Add(publishFormat);

    Since you say that you "found a solution" I presume that you have since corrected this syntax error.

    It is unfortunate, but true, that since MS abandoned the Expression family of programs six years ago, the corresponding forums have become more or less moribund. We're lucky to get 2 to 4 new topics a week over in the Expression Web forum, and this one is even slower. Many seem to have moved on to other products, and you may find that no one familiar enough with the SDK to answer your question will even see it.

    As I said previously, Google is your friend. Try searching various different forms of the search term "using expression encoder sdk" or "programmatically encoding with expression encoder" or other variations. You can also try forums.asp.net and stackoverflow.com to see if they have an answer or can point you to tutorials, etc. Good luck!  ;-)

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    • Edited by paladyn Wednesday, April 12, 2017 8:22 PM
    Wednesday, April 12, 2017 8:18 PM
  • From my understanding I can Capture from the screen with ScreenCaptureJob that outputs to a file, and to publish via http I need to use a LiveJob. I didn't find any way to capture the screen with a LiveJob, nor to publish with a ScreenCaptureJob.

    I tryed first to read from the output file of my ScreenCaptureJob and publish it with a LiveJob, but I had to put a certain delay between the two jobs before the output file can be processed by the LiveJob, and this is not what I need.

    Hmm... in my last reply I was looking mainly at the code, and missed the implication of your first two paragraphs. Leaving aside that the second part of your first paragraph is exactly opposite the first half (and that it's spelled "tried," not "tryed"), the inference to be taken from the second paragraph is that you are trying to publish a screen capture in real time. Is that correct? If so, I do not believe that that is supported. See this thread, where an MCC, MVP, and Microsoft employee, states that real-time capture and publish is not supported in any version of Encoder.

    It is possible to set up Encoder for Live IIS Smooth Streaming, but you must have, or have access to, an IIS Server with IIS Media Services installed. Check out this site, which explains both how to install and configure IIS Media Services into IIS and how to configure Encoder.

    On configuring Encoder, BTW, note that it is done using the EE user interface, not programmatically. I do not know if the EE object model exposes the necessary methods to do this configuration programmatically. In any event, note, however, that this capability requires Expression Encoder Pro, which, unfortunately, is no longer for sale. Even if it were, it was not cheap ($200 or more, IIRC). There are product keys for the Pro version on the Web (YouTube) which may or may not work (I've had success on one machine, failure on another).

    If I am correct in my surmise of your intention, you may want to investigate other live streaming options, such as the open source Open Broadcaster Software. For live streaming to YouTube, there is also "How To Live Stream On YouTube," which uses capabilities provided by YouTube. So, if you're not wedded to writing your own application (which may not even be possible), that may just get the job done for you. Just sayin'...  ;-)

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    • Edited by paladyn Wednesday, April 12, 2017 10:12 PM
    Wednesday, April 12, 2017 9:40 PM
  • Thank you very much for your response and considerations. The code I wrote was only for reference. The one I use is correct. Your info on EE and its usage are correct, I should use other technologies, but since 2014, I developped an app, first in Silverlight, then migrated to WPF, I still use to broadcast via Youtube, basketball games.

    My app has many features like twitter and facebook integration, advertising for commercial return, score and ranking online updates, integration with club's websites, up to three video source at the same time, integration with any video/audio source in the marketplace.

    What I am looking for now is to integrate this app, with all its hardware system, with a media system (amplifier plus video projector) and build a complete entertainment system inside the gym. 

    My objective is to be absolutely cheap and mobile (unfortunately we don't own any gym, so we must be able to mount and dismount the hardware each time, and quickly).

    The actual main problem seams to be the ability to clone a video window (with sound)  from one PC to another, in near real time. I thought to try publish it via http on a local dedicated WiFi network, but it seams not yet to be the right solution, for quality weakness also, even if I tryed it with other software like ffmpeg.

    I thank you very much for your availability on replies.

    chers.

    bruno


    bruno

    Thursday, April 13, 2017 7:26 AM