Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8226137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:39:38+00:00 2026-06-07T15:39:38+00:00

I just started coding an application, my idea is to create something like StreamMyGame

  • 0

I just started coding an application, my idea is to create something like StreamMyGame but for personal use, there is already a project called Single Player Game Transmiter that achieves some of this (http://sourceforge.net/projects/spgt/files/).

So far I’m not encoding nor streaming, I’m just capturing video and displaying it in my app window.

So how could I handle encoding/streaming? I was thinking an UDP stream of raw JPEGs would be the easiest path but I’m not sure.

Also how could I optimize what I have so far? It works fine for video playback but when capturing game windows it doesn’t seem as snappy as the original video, I think it might be due to the fact that it’s running in the background. That leads me to another question, how can I capture the Window with the specified title instead of the active Window?

https://github.com/fr500/desktop_streamer

EDIT:

Some tests with the current Capture Method:

Video Player Capture (960x720p)

starting benchmark
================================================
looking for window: test.mp4
looking for window: test.mp4
looking for window: test.mp4
looking for window: test.mp4
looking for window: test.mp4
================================================
starting single thread capture only test

Time Elapsed: 19480 milliseconds
Frame Time: 32 milliseconds
Rough FPS: 30
Sleeping 2 seconds

starting single thread capture and save as bmp test

Time Elapsed: 19768 milliseconds
Frame Time: 32 milliseconds
Rough FPS: 30
Sleeping 2 seconds

starting single thread capture and save as jpg test

Time Elapsed: 28593 milliseconds
Frame Time: 47 milliseconds
Rough FPS: 20
Sleeping 2 seconds

starting dual thread capture only test

Time Elapsed: 19515 milliseconds
Frame Time: 32 milliseconds
Rough FPS: 30
Sleeping 2 seconds

starting quad thread capture only test

Time Elapsed: 19481 milliseconds
Frame Time: 32 milliseconds
Rough FPS: 30
Sleeping 2 seconds

Crysis 2 Capture (1024x768p)

starting benchmark
================================================
looking for window: Crysis 2 (TM)
looking for window: Crysis 2 (TM)
looking for window: Crysis 2 (TM)
looking for window: Crysis 2 (TM)
looking for window: Crysis 2 (TM)
looking for window: Crysis 2 (TM)
looking for window: Crysis 2 (TM)
================================================
starting single thread capture only test

Time Elapsed: 20003 milliseconds
Frame Time: 33 milliseconds
Rough FPS: 29
Sleeping 2 seconds

starting single thread capture and save as bmp test

Time Elapsed: 20105 milliseconds
Frame Time: 33 milliseconds
Rough FPS: 29
Sleeping 2 seconds

starting single thread capture and save as jpg test

Time Elapsed: 17353 milliseconds
Frame Time: 28 milliseconds
Rough FPS: 34
Sleeping 2 seconds

starting dual thread capture only test

Time Elapsed: 19991 milliseconds
Frame Time: 33 milliseconds
Rough FPS: 30
Sleeping 2 seconds

starting quad thread capture only test

Time Elapsed: 19983 milliseconds
Frame Time: 33 milliseconds
Rough FPS: 30
Sleeping 2 seconds

Saving image to BMP doesn’t really add any overhead but saving as JPG does which gives me an idea of the overhead encoding to video could have. Still the biggest issue is getting the frames themselves it’s too slow as it is now, it can’t keep up and as a result some frames are missing. If frames could be captured at 60+ fps the encoding + streaming delay could be really manageable for single player games.

I will try a DX hook approach to get the frames.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:39:40+00:00Added an answer on June 7, 2026 at 3:39 pm

    I’m not sure if performance/quality issues are effect of running in the background, however I’ll try to answer your question.

    Capturing window by its name

    I suppose you can try to use FindWindow function instead of GetForegroundWindow that is used in the application. It allows you to get handle to a window by its title. In order to do this (in the desktop_streamer project you’ve posted a link to), go to the ScreenCapture class and:

    • change

      [DllImport("user32.dll")]
      private static extern IntPtr GetForegroundWindow();
      

      to

      [DllImport("user32.dll", SetLastError = true)]
      private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
      
    • in Capture method change the line

      var foregroundWindowsHandle = GetForegroundWindow();
      

      to

      var foregroundWindowsHandle = FindWindow(null, "mywindowName");
      

    I haven’t tested this, so if you have any issues with running the code, let me know, so we can look for a solution.

    For more information about FindWindow function, take a look here: http://www.pinvoke.net/default.aspx/user32.findwindow.

    Performance and images quality

    When talking about performance, you may want to try measure network speed and latency in real time and then use those information to adjust images quality (compression level and resolution) appropriately. This can make the transmitted image pixelated from time to time, but should decrease effect of laggy gameplay.

    You may also want to take a look at this page giving some performance comparison of two of the screen capturing methods: http://blog.bobcravens.com/2009/04/fastest-screen-capture-using-c-vista-vs-win7/. It may help you improve te performance of screen capturing process, but as you can see, frame rates achieved are still too low to provide high quality gaming experience.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just started working with Mercurial a few days ago and there's something I don't
I've just started to use Partials in my rails application, at the moment i
I just started coding a new application for Android and stumble over a warning.
I just started to do some Wordpress Theme Coding. I would like to integrate
I recently started work on a personal coding project using C++ and KDevelop. Although
Just started coding in AS3 with FlashDevelop and coming from a C# background, I
I have just started coding in AS3 and it would be really great to
Just started mongo and started having issue with querying already. i have a collection
Just started my first MVC 2.0 .net application. And I set up some default
I have just started working on my first Android application and am going ok.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.