• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 550
  • Last Modified:

Capture activities on screen and save it in avi file

Hi All,

        I am working on a desktop application with vb.net.
     Please help me that how i can capture activities on screen and to save it
     in a media file like avi.And after this i can play it in media player.
     

Thanks,  

Regards
Bkniazi.
0
bkniazi
Asked:
bkniazi
  • 8
  • 7
1 Solution
 
armoghanCommented:
Hi bkniazi,
Try using Windows Media Encoder 9 Series, You have to play with its API to record everything
also see this link
http://www.codecomments.com/MSDN/message206896.html
Cheers!
0
 
bkniaziAuthor Commented:
Dear armoghan,
I want coding in vb.net to record and save activities on screen.such as mouse movements
writing in ms word and so on.And then i can open it in window media player.
0
 
armoghanCommented:
Unfortunately, I dont have a ready made sample in VB.NET.
Actually only free software that has the ability to capture Movie is Windows Media Encorder
Its SDK is available. So i means that such kind of thing can be done using it.

http://www.microsoft.com/windows/windowsmedia/9series/encoder/extensible.aspx


The otherway is capture screen shorts with Mouse after specific intervals and save them as Bitmaps and then convert them in an AVI somehow..

Unfortunatley, both methods are difficult and only bits and pieces of code is available on Internet. But the better solution is using Windows Media Encorder.
You have to look into its SDK to do the desired thing.


0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
bkniaziAuthor Commented:
Dear armoghan,
I do not require a software to do my task I am developing it myself.
So require some help in this area of VB.NET.
Thanks
0
 
armoghanCommented:
Sorry, probably i could not clear myself. thats is what I am trying to say is
The SDK below will help you write such code in VB.NET. But you have to look into it
0
 
bkniaziAuthor Commented:
Dear armoghan,
I am trying to use the window media encoder to complete this work
but if you send a small application in vb.net which can record activities on screen during
run time then i will be thankful....................

thanks
0
 
armoghanCommented:
Ok see this code, It has been taken from the SDK's CHM file
under the heading "Using a Screen Capture as a Source" you can find it easily in C:\WMSDK\WMEncSDK9\wmencsdk.chm in search window
This can be further enhanced to the required thing.

' Declare objects and variables.
  Dim Encoder as WMEncoder
  Dim SrcGrpColl As IWMEncSourceGroupCollection
  Dim SrcGrp As IWMEncSourceGroup
  Dim SrcVid As IWMEncVideoSource

' Create a WMEncoder object.
  Set Encoder = New WMEncoder

' Retrieve a source group collection.
  Set SrcGrpColl = Encoder.SourceGroupCollection

' Create a source group called SG_1.
  Set SrcGrp = SrcGrpColl.Add("SG_1")

' Create a video source object and an audio source object.
  Set SrcVid = SrcGrp.AddSource(WMENC_VIDEO)

' Specify the screen capture plug-in to set up the video source.
  SrcVid.SetInput "ScreenCap://ScreenCapture1"
0
 
bkniaziAuthor Commented:
Dear armoghan,
 Thanks I have checked the sample of window media encoder which encode a previosely
saved media file so how i can capture the working on screen and at the end i can save it
in a media file.I think you will have understand my requirements.If not then you
can ask any time.Many Thanks for your help.
0
 
armoghanCommented:
Ok I have placed the demo and src on codeproject.com
here is the link
http://www.codeproject.com/useritems/CaptureScreenAsVideo.asp
0
 
bkniaziAuthor Commented:
any more help plz
0
 
bkniaziAuthor Commented:
Thanks ArmoghanAsif,
I am checking the application you posted now.
0
 
bkniaziAuthor Commented:
Hi Armoghan,
The application is working well but the colors and pictures of the
movie are not looking very good.
Please help for this problem.
0
 
bkniaziAuthor Commented:
Dear armoghan,
The problem in this application is that the windows media encoder must be
installed before running this project.
So is there any way that i did not install the windows media encoder and can run the
application Or any other way to complete this task.plz help.
Many thanks.
0
 
armoghanCommented:
Ok for Color porblem
see such code commented in the src.
You have to find the approriate Profile and Attach it with SrcGrp

in this code
If Pro.Name = "Windows Media Video 8 for Local Area Network (384 Kbps)" Then
                SrcGrp.Profile = Pro
                Exit For
        End If

About the windows Media Instalation problem.
When you will make the setup of the project, you should include Media Encoder in it so that it installs first on the system.

Please ask all other questions on the Thread in Codeproject site at the bottom and close this question
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 8
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now