Capture desktop image continuously
hi friends,
i am doing a project in which i have to transfer desktop image of server
to all clients.i have used multithreading.like one thread for each client and one
thread for capturing image.
i have two programs RobotServer.java and RobotClient.java . They work well.but i want to check authentication of client and then send images to client. so i ahve just added one program i.e. JFrame to check authentication of client.
after authentication of client i have just created object of RobotClient.java so that it can take images sent by server.but i am not able to see images coming from server. after adding just one frame in between something is going wrong.
can plz anyone help to find where am i going wrong?
U said... u have two programs RobotServer.java and RobotClient.java where are they ?
cant proceed without any code...
Similar Messages
-
Capture an image of my desktop
In windows I used to be able to capture an image of my desktop, for support reasons or to show the program that was open.
I don't know how to do this with my iMac, can anyone suggest a suitable way of doing it please?
Many thanks.
Mike.Press the Shift, Command, and 3 keys, or Shift, Command, and 4 followed by enclosing the desired portion of the screen.
(69328) -
Compressed VideoFormat for sending Desktop Images
Hi All,
In JMF 2.1.1 solutions, the ScreenGrabber captures the desktop images and uses RGBFormat. Which other VideoFormats can we use so that we can send the compressed data using RTP but still allow higher resolutions. JPEGFormat suports higher resolutions ?Source format doesn't matter. JMF will transcode whatever the source format is into whatever the RTP format is for you automaticlly. Max resolution you're going to get is the minimum of the two.
[http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/formats.html]
In windows, that leaves you with the options of JPEG and H.263, but H.263 at maximum supports CIF (352x288), so you're going to want to use JPEG_RTP as your video format. -
How do I photograph &/or save part of a desktop image?
command + shift + 4
Move the cursor to one corner of the area you want to capture, hold the mouse button down, outline a rectangle. That rectangle is captured.
The screen shot will end up on your desktop. -
Re: Capture the Image from a video file
Thanks a lot. But when I view the program in the thread, it seems that it needs to some program code is to play the video first and then the image can be captured. Is it possible that even I don't write the code for playing the video first and just write the captured code so that can still capture the image by using Java only from the exists video file. Thanks a lot.
Thanks a lot. But when I view the program in the thread, it seems that it needs to some program code is to play the video first and then the image can be captured. Is it possible that even I don't write the code for playing the video first and just write the captured code so that can still capture the image by using Java only from the exists video file. Thanks a lot.You can get away without playing the video by seeking to the frame you want using FramePositioningControl ( [example here|http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/Seek.html] )and then capturing the frame using FrameGrabbingControl (similar to the code I posted). But still you would have to load the video file, create the player using url, realize the player, perhaps prefetch it (all in the link I have given above) then you are ready to seek to particular frame and capture it. But now you don't need to actually start the player so that video/audio is visible/audible.
Thanks! -
Capturing an image from webcam
hi, i'm trying to capture a image from a webcam, but i don't have a clue of how to do this, could anyone help me with samples or books.
thanks.hi
so as i understood u want to access the USB and make whats called camera interaction i worked with my webcam and i generate a video stream and i'm working now to sample this video
i found these class on the internet u have to make a littel changes like camera defention
* File: DeviceInfo.java.java
* created 24.07.2001 21:44:12 by David Fischer, [email protected]
import java.awt.Dimension;
import javax.media.*;
import javax.media.control.*;
import javax.media.format.*;
import javax.media.protocol.*;
public class DeviceInfo
public static Format formatMatches (Format format, Format supported[] )
if (supported == null)
return null;
for (int i = 0; i < supported.length; i++)
if (supported.matches(format))
return supported[i];
return null;
public static boolean setFormat(DataSource dataSource, Format format)
boolean formatApplied = false;
FormatControl formatControls[] = null;
formatControls = ((CaptureDevice) dataSource).getFormatControls();
for (int x = 0; x < formatControls.length; x++)
if (formatControls[x] == null)
continue;
Format supportedFormats[] = formatControls[x].getSupportedFormats();
if (supportedFormats == null)
continue;
if (DeviceInfo.formatMatches(format, supportedFormats) != null)
formatControls[x].setFormat(format);
formatApplied = true;
return formatApplied;
public static boolean isVideo(Format format)
return (format instanceof VideoFormat);
public static boolean isAudio(Format format)
return (format instanceof AudioFormat);
public static String formatToString(Format format)
if (isVideo(format))
return videoFormatToString((VideoFormat) format);
if (isAudio(format))
return audioFormatToString((AudioFormat) format);
return ("--- unknown media device format ---");
public static String videoFormatToString(VideoFormat videoFormat)
StringBuffer result = new StringBuffer();
// add width x height (size)
Dimension d = videoFormat.getSize();
result.append("size=" + (int) d.getWidth() + "x" + (int) d.getHeight() + ", ");
// try to add color depth
if (videoFormat instanceof IndexedColorFormat)
IndexedColorFormat f = (IndexedColorFormat) videoFormat;
result.append("color depth=" + f.getMapSize() + ", ");
// add encoding
result.append("encoding=" + videoFormat.getEncoding() + ", ");
// add max data length
result.append("maxdatalength=" + videoFormat.getMaxDataLength() + "");
return result.toString();
public static String audioFormatToString(AudioFormat audioFormat)
StringBuffer result = new StringBuffer();
// short workaround
result.append(audioFormat.toString().toLowerCase());
return result.toString();
the second class:
* File: MyDataSinkListener.java
* created 24.07.2001 21:41:47 by David Fischer, [email protected]
* Decription: simple data sink listener, used to check for end of stream
import javax.media.datasink.*;
public class MyDataSinkListener implements DataSinkListener
boolean endOfStream = false;
public void dataSinkUpdate(DataSinkEvent event)
if (event instanceof javax.media.datasink.EndOfStreamEvent)
endOfStream = true;
public void waitEndOfStream(long checkTimeMs)
while (! endOfStream)
Stdout.log("datasink: waiting for end of stream ...");
try { Thread.currentThread().sleep(checkTimeMs); } catch (InterruptedException ie) {}
Stdout.log("datasink: ... end of stream reached.");
* File: MyDataSinkListener.java
* created 24.07.2001 21:41:47 by David Fischer, [email protected]
* Decription: simple data sink listener, used to check for end of stream
import javax.media.datasink.*;
public class MyDataSinkListener implements DataSinkListener
boolean endOfStream = false;
public void dataSinkUpdate(DataSinkEvent event)
if (event instanceof javax.media.datasink.EndOfStreamEvent)
endOfStream = true;
public void waitEndOfStream(long checkTimeMs)
while (! endOfStream)
Stdout.log("datasink: waiting for end of stream ...");
try { Thread.currentThread().sleep(checkTimeMs); } catch (InterruptedException ie) {}
Stdout.log("datasink: ... end of stream reached.");
}[i]the 3rd class:/******************************************************
* File: Stdout.java.java
* created 24.07.2001 21:44:46 by David Fischer, [email protected]
* Description: utility class for standard output
public class Stdout
public static void log(String msg)
System.out.println(msg);
public static void logAndAbortException(Exception e)
log("" + e);
flush();
System.exit(0);
public static void logAndAbortError(Error e)
log("" + e);
flush();
System.exit(0);
public static void flush()
System.out.flush();
the 4rt is :
* File: TestQuickCamPro.java
* created 24.07.2001 21:40:13 by David Fischer, [email protected]
* Description: this test program will capture the video and audio stream
* from a Logitech QuickCam� Pro 3000 USB camera for 10 seconds and stores
* it on a file, named "testcam.avi". You can use the microsoft windows
* media player to display this file.
* operating system: Windows 2000
* required hardware: Logitech QuickCam� Pro 3000
* required software: jdk 1.3 or jdk1.4 plus jmf2.1.1 (www.javasoft.com)
* source files: DeviceInfo.java, MyDataSinkListener.java,
* Stdout.java, TestQuickCamPro.java
* You can just start this program with "java TestQuickCamPro"
* hint: please make shure that you setup first the logitech camerea drives
* and jmf2.1.1 correctly. "jmf.jar" must be part of your CLASSPATH.
* useful links:
* - http://java.sun.com/products/java-media/jmf/2.1.1/index.html
* - http://java.sun.com/products/java-media/jmf/2.1.1/solutions/index.html
* with some small modifications, this program will work with any USB camera.
import java.io.*;
import javax.media.*;
import javax.media.control.*;
import javax.media.datasink.*;
import javax.media.format.*;
import javax.media.protocol.*;
public class TestQuickCamPro
private static boolean debugDeviceList = false;
private static String defaultVideoDeviceName = "vfw:Microsoft WDM Image Capture (Win32):0";
private static String defaultAudioDeviceName = "DirectSoundCapture";
private static String defaultVideoFormatString = "size=176x144, encoding=yuv, maxdatalength=38016";
private static String defaultAudioFormatString = "linear, 16000.0 hz, 8-bit, mono, unsigned";
private static CaptureDeviceInfo captureVideoDevice = null;
private static CaptureDeviceInfo captureAudioDevice = null;
private static VideoFormat captureVideoFormat = null;
private static AudioFormat captureAudioFormat = null;
public static void main(String args[])
// get command line arguments
for (int x = 0; x < args.length; x++)
// -dd = debug devices list -> display list of all media devices - and exit
if (args[x].toLowerCase().compareTo("-dd") == 0)
debugDeviceList = true;
// get a list of all media devices, search default devices and formats, and print it out if args[x] = "-dd"
Stdout.log("get list of all media devices ...");
java.util.Vector deviceListVector = CaptureDeviceManager.getDeviceList(null);
if (deviceListVector == null)
Stdout.log("... error: media device list vector is null, program aborted");
System.exit(0);
if (deviceListVector.size() == 0)
Stdout.log("... error: media device list vector size is 0, program aborted");
System.exit(0);
for (int x = 0; x < deviceListVector.size(); x++)
// display device name
CaptureDeviceInfo deviceInfo = (CaptureDeviceInfo) deviceListVector.elementAt(x);
String deviceInfoText = deviceInfo.getName();
if (debugDeviceList)
Stdout.log("device " + x + ": " + deviceInfoText);
// display device formats
Format deviceFormat[] = deviceInfo.getFormats();
for (int y = 0; y < deviceFormat.length; y++)
// serach for default video device
if (captureVideoDevice == null)
if (deviceFormat[y] instanceof VideoFormat)
if (deviceInfo.getName().indexOf(defaultVideoDeviceName) >= 0)
captureVideoDevice = deviceInfo;
Stdout.log(">>> capture video device = " + deviceInfo.getName());
// search for default video format
if (captureVideoDevice == deviceInfo)
if (captureVideoFormat == null)
if (DeviceInfo.formatToString(deviceFormat[y]).indexOf(defaultVideoFormatString) >= 0)
captureVideoFormat = (VideoFormat) deviceFormat[y];
Stdout.log(">>> capture video format = " + DeviceInfo.formatToString(deviceFormat[y]));
// serach for default audio device
if (captureAudioDevice == null)
if (deviceFormat[y] instanceof AudioFormat)
if (deviceInfo.getName().indexOf(defaultAudioDeviceName) >= 0)
captureAudioDevice = deviceInfo;
Stdout.log(">>> capture audio device = " + deviceInfo.getName());
// search for default audio format
if (captureAudioDevice == deviceInfo)
if (captureAudioFormat == null)
if (DeviceInfo.formatToString(deviceFormat[y]).indexOf(defaultAudioFormatString) >= 0)
captureAudioFormat = (AudioFormat) deviceFormat[y];
Stdout.log(">>> capture audio format = " + DeviceInfo.formatToString(deviceFormat[y]));
if (debugDeviceList)
Stdout.log(" - format: " + DeviceInfo.formatToString(deviceFormat[y]));
Stdout.log("... list completed.");
// if args[x] = "-dd" terminate now
if (debugDeviceList)
System.exit(0);
// setup video data source
MediaLocator videoMediaLocator = captureVideoDevice.getLocator();
DataSource videoDataSource = null;
try
videoDataSource = javax.media.Manager.createDataSource(videoMediaLocator);
catch (IOException ie) { Stdout.logAndAbortException(ie); }
catch (NoDataSourceException nse) { Stdout.logAndAbortException(nse); }
if (! DeviceInfo.setFormat(videoDataSource, captureVideoFormat))
Stdout.log("Error: unable to set video format - program aborted");
System.exit(0);
// setup audio data source
MediaLocator audioMediaLocator = captureAudioDevice.getLocator();
DataSource audioDataSource = null;
try
audioDataSource = javax.media.Manager.createDataSource(audioMediaLocator);
catch (IOException ie) { Stdout.logAndAbortException(ie); }
catch (NoDataSourceException nse) { Stdout.logAndAbortException(nse); }
if (! DeviceInfo.setFormat(audioDataSource, captureAudioFormat))
Stdout.log("Error: unable to set audio format - program aborted");
System.exit(0);
// merge the two data sources
DataSource mixedDataSource = null;
try
DataSource dArray[] = new DataSource[2];
dArray[0] = videoDataSource;
dArray[1] = audioDataSource;
mixedDataSource = javax.media.Manager.createMergingDataSource(dArray);
catch (IncompatibleSourceException ise) { Stdout.logAndAbortException(ise); }
// create a new processor
// setup output file format ->> msvideo
FileTypeDescriptor outputType = new FileTypeDescriptor(FileTypeDescriptor.MSVIDEO);
// setup output video and audio data format
Format outputFormat[] = new Format[2];
outputFormat[0] = new VideoFormat(VideoFormat.INDEO50);
outputFormat[1] = new AudioFormat(AudioFormat.GSM_MS /* LINEAR */);
// create processor
ProcessorModel processorModel = new ProcessorModel(mixedDataSource, outputFormat, outputType);
Processor processor = null;
try
processor = Manager.createRealizedProcessor(processorModel);
catch (IOException e) { Stdout.logAndAbortException(e); }
catch (NoProcessorException e) { Stdout.logAndAbortException(e); }
catch (CannotRealizeException e) { Stdout.logAndAbortException(e); }
// get the output of the processor
DataSource source = processor.getDataOutput();
// create a File protocol MediaLocator with the location
// of the file to which bits are to be written
MediaLocator dest = new MediaLocator("file:testcam.avi");
// create a datasink to do the file
DataSink dataSink = null;
MyDataSinkListener dataSinkListener = null;
try
dataSink = Manager.createDataSink(source, dest);
dataSinkListener = new MyDataSinkListener();
dataSink.addDataSinkListener(dataSinkListener);
dataSink.open();
catch (IOException e) { Stdout.logAndAbortException(e); }
catch (NoDataSinkException e) { Stdout.logAndAbortException(e); }
catch (SecurityException e) { Stdout.logAndAbortException(e); }
// now start the datasink and processor
try
dataSink.start();
catch (IOException e) { Stdout.logAndAbortException(e); }
processor.start();
Stdout.log("starting capturing ...");
try { Thread.currentThread().sleep(10000); } catch (InterruptedException ie) {} // capture for 10 seconds
Stdout.log("... capturing done");
// stop and close the processor when done capturing...
// close the datasink when EndOfStream event is received...
processor.stop();
processor.close();
dataSinkListener.waitEndOfStream(10);
dataSink.close();
Stdout.log("[all done]");
}finally search with the athour name there is an additional program u must download to detect ur cam .
i hope that is work with u -
hi all
i want to the program in wich i have to capture the image or getting snapshot and stored thet perticular image in perticular folder.Continuous streaming of the done and i wan t to take snapshot from the continuous streaming .thanxAre you playing the images (video actually) recorded by your camera and at one moment you want to take a snapshot?
Take a look at the VideoControl class and the method getSnapshot(...).
Have you done some coding yet by which you display what your camera is recording?
Mihai -
Capturing live image from integrated Webcam using Labview
How can i capture live image from my laptop integrated webcam using LabVIEW ?
Even after installing all the IMAQ drivers, MAX is not displaying my integrated webcam ?
Why is it so ?
do i need to install some additional drivers for this ?
Thanks and Regards
Gaurav Palhi, you can use NI Vision Assistant
IDE ofNI Vision Assistant
..select acquire images
...select option 2
...select devices: CAM0 (default webcam), video mode resolution
...option 1 acquire single, option 2 acquire continuous
Atom
Certified LabVIEW Associate Developer -
"Unable to capture window image"
if I select a window to be screenshot, I get this error:
Your screen shot can’t be saved.
Unable to capture window image.
(shortcut: cmd-shift-4 and then space)
It seems to be new in Lion. Never had that problem before. And regular screenshots seem to work fine (cmd-shift-3).
Thanks for any help! ~ KaiThanks Davide ...
I created com.apple.screencapture.plist with Terminal and restarted the Mac.
The first couple of window screenshots worked on a Chrome browser window (command-shift-4, then space bar). But it did not work on other app's windows (Finder, Carousel).
Then I switched back to Chrome and I didn't work there too anymore. Crazy thing is that now it works on Finder windows. Very very strange.
All this is only true for capturing a whole window content (command-shift-4, then space bar)
~ Kai -
Camera - Torch 9800 - Unable to capture the image
Hey everyone!
Had a torch 9800 for 18 months now and always been working fine... until today.
I went to use the camera and it all seemed to open up fine but instead of seeing what the lens sees the screen was black. The centre focus [ ] was there and I could zoom back and forth just a black screen.
When I click for a photo I get a message " Unable to capture the image "
I have searched the web and found nothing conclusive. Battery pulls, a full wipe and installation of the o/s have made no difference to it's lack of function.
Does anyone out there have a suggestion?I am having the exact same issue. I also tried rebooting, taking out the battery and sim card and cleaning out the back, alas no difference.
-
Deployment Workbench - how to capture an image after customisation?
I have deployed Vista to a machine using WinPE (Created through Workbench) and chose the option when deploying "Prepare for capture"
I then customised Vista - in this case removing the Fax applications and ran Sysprep with OOBE, Generalise and Shutdown.
In workbench I created a new task sequence 'Standard Client Replace task sequence' which seems to be the right task to capture an image.
When selecting the task when booting the machine with WinPE, it forces me to capture the user data - I cannot select 'Do not save data and settings'
I must be doing something wrong!
What I want to do is:
Deploy Vista
Install some apps manually i.e. not using a task sequence
Capture the image
Deploy to machines
How can I do this using Workbench? Thanks.Hi,
Thank you for the reply.
I suggest referring to the following article:
Creating a Computer Image
http://technet.microsoft.com/en-us/library/bb977918.aspx
If you select “Capture an image of this reference computer” on the “Specify whether to capture an image” page when running Deployment Wizard, it will sysprep and capture the system for you automatically.
If you would like to
“Install Vista and prepare for capture
Install my own applications WITHOUT using task sequences
Capture the OS”,
I am afraid that you do not need to use MDT (you cannot perform a LTI without running Task Sequences). You can do this by only using WDS.
1. Install and configure the WDS Server.
2. Add the default Windows Server 2008 boot image to the WDS Server.
3. Create Capture Boot Image and add it to boot image in WDS Server.
4. Create a reference computer (install the operating system, applications, and make any other changes)
5. Sysprep.
6. PXE boot the reference computer into capture image on the boot screen and then capture the image (If non-PXE supported, make a discover image to boot)
7. Upload the captured image to WDS server.
8. Clients can PXE boot and install Windows (If non-PXE supported, use a discover image to boot).
Hope it helps.
Tim Quan - MSFT -
How to capture an image from a clip
Hi,
Is there a way to capture an image from a movie clip using iMovie 06?
I would like to save some frames from the vedio footage as photos.
Any help will be greatly appreciated. Thank you.
New Mac User
Mac OS X (10.4.5)Hi iMac User:
Yes-you can save a single frame from iMovie by selecting the File-->Save Frame As option. From there it will ask you where and in what format you want to save it.
Just be aware that the quality won't be perfect because it is taken from a video clip.
Sue -
How to capture an image and save it using action script
Hello,
I need to know if is posible to capture an image or a screen region and save it using action scrip.
Somebody know how to do it ??
Thanksyou can capture an image using the bitmapdata class and getPixel(). you can then save that to a bitmap using server-side code like php.
-
How to capture an image from my usb camera and display on my front panel
How to capture an image from my usb camera and display on my front panel
Install NI Vision Acquisition Software and NI IMAQ for USB and open an example.
Christian -
Capture an image using the web camera from a web application
Hi All,
Could anyone please share the steps what have to be followed for capture an image using the web camera from a web application.
I have a similar requirement like this,
1) Detect the Webcam on the users machine from the web application.(To be more clear when the user clicks on 'Add Photo' tool from the web application)
2) When the user confirms to save, save the Image in users machine at some temporary location with some unique file name.
3) Upload the Image to the server from the temporary location.
Please share the details like, what can be used and how it can be used etc...
Thanks,
Suman1) Detect the Webcam on the users machine from the web application.(To be more clear when the user clicks on 'Add Photo' tool from the web application)There's not really any good way to do this with JMF. You'd have to somehow create a JMF web-start application that will install the native JMF binaries, and then kick off the capture device scanning code from the application, and then scan through the list of devices found to get the MediaLocator of the web cam.
2) When the user confirms to save, save the Image in users machine at some temporary location with some unique file name.You'd probably be displaying a "preview" window and then you'd just want to capture the image. There are a handful of ways you could capture the image, but it really depends on your situation.
3) Upload the Image to the server from the temporary location.You can find out how to do this on google.
All things told, this application is probably more suited to be a FMJ (Freedom for Media in Java) application than a JMF application. JMF relies on native code to capture from the web cams, whereas FMJ does not.
Alternately, you might want to look into Adobe Flex for this particular application.
Maybe you are looking for
-
File cannot be deleted from desktop?
I have an excel file on my desktop named "77B72200" that will not move to the trash! It's driving me nuts and it won't even move into another folder or anything, it is completely unresponsive. I am almost positive that it appeared there when I downlo
-
Outlook 2010 and Adobe Acrobat 9
I just purchase 3 licences of Adobe Acrobat 9 two days ago, and i notice that i can't create PDF with all methadata, and all attachment on it (like what i was able to do with Adobe Acrobat 9 + Outlook 2007 and 2003). So my question is : Is there a fi
-
Problem uploading .apk to Afaria
Hi, I have a problem with uploading newer version of the .apk file to the distribution policy. After uploading a file on the server, name and version information are displayed correctly, but selecting ok does not result in saving policy. Server log a
-
I have Elements 11. I have liked and used the organizer for years, but I do not like this one. Can I delete all photos from the organizer but not the computer. I want to use the Picture file to organize and the editor to manipulate photos and then
-
Samsung 2493HM, Epson 2880 CS4 Profile Problems
Hardware Datacolor Spyder2 Samsung 2493HM Epson 2880 Windows XP SP3 ATI HD 5670 Using DVI not HDMI For months I've been printing using a photo lab with no problems. I finaly replaced my old Epson R280 with a R2880. I've loaded the icc profiles for