Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Dear all.
Prompt please. Need to implement a program that will capture the desktop screen at 24 frames per second to video stream and send by rtmp-protocol to the server. Should I start and what do you recommend libraries to use?
Posted
Updated 12-Aug-14 6:30am
v2
Comments
PIEBALDconsult 12-Aug-14 12:36pm    
I hope you're not trying to spy on someone.
evich.ilya 12-Aug-14 12:49pm    
No, I will not be to monitor for someone)
Sergey Alexandrovich Kryukov 12-Aug-14 18:40pm    
Great to hear that. :-)
—SA
Sergey Alexandrovich Kryukov 12-Aug-14 18:39pm    
WPF? System.Windows.Forms? Anything else?
—SA

1 solution

The biggest problem is your "24 frames per second" requirement. Windows is not a real-time system, so, with some probability, you may fail to deliver exact frame rate; some delays will be possible. You can use multimedia-system timer to improve the reliability if it, but it will require P/Invoke or C++/CLI (mixed, managed+unmanaged mode). You can start here:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd757634%28v=vs.85%29.aspx[^],
http://www.pinvoke.net/default.aspx/winmm/timesetevent.html?diff=y[^] (P/Invoke already done for you).

Perhaps you may not be so strict about your timing (considering your purpose), the you can use one of .NET timers:
http://msdn.microsoft.com/en-us/library/system.threading.timer%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.timers.timer%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.timer%28v=vs.110%29.aspx[^] — never ever try to use this timer for anything which require any accuracy at all, anything supposed to be even approximately periodic,
http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer%28v=vs.110%29.aspx[^] (specific mostly to WPF, can only be suitable if your application also uses WPF UI).

Screen capture is possible in WPF or System.Windows.Forms and is trivial. Hope you will find out how to do it yourself, depending on your settings: http://bit.ly/1p36knv[^].

It leave for more difficult part: the use of RTMP protocol: http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol[^].

I would look at the library LibRTMP.NET.Windows released under Google Code, supplied with rtmp-mediaplayer: https://code.google.com/p/rtmp-mediaplayer[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900