Capture device in use

Hi,
I am using jmf to capture device video, How I can test if the video device is in use or no?
thinks

I use the following function to create a clone data source.But I have an exception:IOException:capture device in use
Can u help me?
public DataSource initDevice()
Vector formatsCatalog = new Vector();
Vector audioDevices = new Vector();
Vector videoDevices = new Vector();
Vector devices = new Vector();
// rcupration des priphriques disponibles
devices = CaptureDeviceManager.getDeviceList (null);
CaptureDeviceInfo cdi;
if (devices != null && devices.size() > 0)
int devicesNum = devices.size();
Format[] formats;
for ( int i = 0; i < devicesNum; i++)
cdi = (CaptureDeviceInfo) devices.elementAt (i);
formats = cdi.getFormats();
formatsCatalog.addElement(formats);
// on spare les periphriques audio et vido
for (int j = 0; j < formats.length; j++)
if (formats[j] instanceof AudioFormat)
audioDevices.addElement(cdi);
break;
else if (formats[j] instanceof VideoFormat)
videoDevices.addElement(cdi);
break;
CaptureDeviceInfo cdiVideo;
// on recupre l'unique device video
cdiVideo = (CaptureDeviceInfo) (videoDevices).elementAt(0);
// on recupere les formats disponibles
Format[] video = cdiVideo.getFormats();
// on slctionne un format
format = video[3];
System.out.println("Type: " + video[3].getEncoding() + " Data: " + video[3].getDataType());
try {
// on cr le DataSource
ds = Manager.createDataSource(cdiVideo.getLocator());
this.dsclone =(DataSource) Manager.createCloneableDataSource(ds);
// ds= (DataSource) ((SourceCloneable)ds).createClone();
return dsclone;
catch (IOException ioe) {
System.out.println("Capture device "+ioe);
System.out.println("Capture device "+ioe.getMessage());
catch (NoDataSourceException ndse) {
System.out.println(ndse);
return null;
}

Similar Messages

  • Java.io.IOException: Capture device in use

    I used jmf to create a video server that can send video to several client. when I test program with only client, it's ok. But,if I use more than 1 client, the program generate an exception:
    java.io.IOException: Capture device in use
    best regards

    java_developper wrote:
    I used jmf to create a video server that can send video to several client. when I test program with only client, it's ok. But,if I use more than 1 client, the program generate an exception:
    java.io.IOException: Capture device in useThen you've most likely designed your program wrong.
    If you're using more than one input DataSource in the case when you have more than 1 client, then you're doing it wrong.
    Assuming you're using the proper RTP infastructure, you'll just need to add each client as a target for the RTPManager. If what I just said doesn't make sense, then you're doing it wrong.
    [http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/apidocs/javax/media/rtp/RTPManager.html]
    Please see section 2, "Multi-Unicast Session"

  • Detect whether capture device in use?

    Hi
    I want to detect whether the capture device in use in JMF.
    I looked at the MediaLocator and CaptureDeviceInfo but I can't see any method to do that.
    There is also no exception class for it?
    So my questions are:
    1) Whether we can detect a capture device in use?
    2) Whether we can free the capture device ( The device is used by another thread or program) or to say take control of it.
    Thank you very much.
    Regards
    K.

    1) Whether we can detect a capture device in use? If you know the media locator of the device, and you attempt to use it while it's in use... you'll get an exception thrown. Not sure which one, but I'd imagine an IOException of some sort...
    2) Whether we can free the capture device ( The device is used by another thread or program) or to say take control of it. You cannot.

  • Java: Capture Device in use...

    Hello everyone!!!!
    After an effort of two days (almost 20 hours), i couldn't find the solution and finally want any of you to, please solve my problem or guide me.
    I have an application, when i run my application, it shows some GUI, i press Record, and it starts recording video through video cam.
    Now when i stop it and again try to Record, it throws an exception, Capture Device in use.
    I tried,
    p.stop();
    p.deallocate();before closing the recording screen but still there are issues. Can you kindly tell, how to release all the resources from the Processor(p is processor)
    Thanks.

    SOLVED...
    Please lock this thread.

  • "Capture device offline" - using Logitech webcam 9000

    I am wanting to capture video using my Logitech webcam 9000, but I get "Capture device offline" in Adobe Premiere Pro when I attempt to capture video.  Could someone provide some guidance on how to get this to work?
    I used this webcam to capture video in Corel Visual Studio just fine, but I am having issues in Adboe.
    thanks.

    Welcome to the forum.
    Given that hardware, I would just continue using Corel. You can Export from it, or perhaps that would be a Save operation (do not know that software), and then Import those files into PrPro for editing.
    I do not even think that OnLocation will be suitable for the hardware.
    Good luck,
    Hunt

  • Looking for RCA capture device for streaming

    My newspaper does some random video streaming of some events...however, we generally use a Windows PC Laptop (which is less powerful than the MacBook Pro I'm wanting to use, for several reasons such as convinience and well, the better performance).
    We have a RCA capture device that takes video and audio in from a basic Canon video camera and then feed that into Livestream.
    I know Blackmagic Design has a video capture device for Apple, but it's $149. Is there something cheaper out there for Macs? Our RCA capture device we use on Windows will not work on Mac.
    It just takes the RCAs and we plug it into the USB port. A firewire port would be fine too.

    I have read through some more forums and I only found one mention of the Media Manager 'Recomress' function.
    It said:
    "Transcoding with MM (recompress). It preserves timecode/reel name, file names, etc... Except the clip ID, which is used along with reel name and timecode to batch capture from source files (at least for P2)."
    Clip ID is the metadata relyable for the work of batch capture. It seems without it it is impossible to batch capture.
    I wonder why they designed Recompress like that, if it is true?

  • Supported Video Capture Devices?????

    I recently purchased the Adobe Photoshop Elements Premium 8.0.  I am now looking for a VIDEO CAPTURE DEVICE that is supported for use with this software.  Adobe offically only says Matrox brand devices are acceptable but these devices are expensive.
    I've also heard about the Canopus 110 for about $200.
    If anyone can make a suggestion on which Capture Device to use, which ones are recommended or the one that just seems to work best, I would appreciate it.
    Thanks,
    Robert 

    You would get a better answer @ http://forums.adobe.com/community/premiere/premiere_elements

  • Which capture devices work?

    Hi everyone,
    I've never seen such an important detail to be so difficult to find
    I know they say he device must have directshow etc etc but i can't just find a list.
    Can anyone let me know what capture device you use that you know works? Thanks!!
    We are using FMLE for streaming our church services live and I have a deal on a Videonics MX-1 which I am thinking of getting if I can quickly find a device I can go through from the MX-1 to the PC that will work. I have a cheap Video to USB "Easy cap" which I am trying with FMLE but it does not work very well, at least not with the VCR signal I am sending it...
    thanks for your help everyone...

    Pondini,
    Wow, I thought this would be fairly simple!  Turning out to be quite a complicated thing.
    I really need to figure this out...
    Would you say this is a good solution:
    1. Use a Time Capsule as my media storage drive
    2. Attach an external hard drive to the Time Capsule
    3. Use Time Machine to backup my main computer and my Time Capsule to the external hard drive
    If that doesn't work, I'm kind of stumped as to how I would back up my media from a networked drive.
    I like the stability of Apple's Airport Extremes/Time Capsules.  But perhaps I should be looking at another wireless router?
    Thanks again,
    Matthew

  • [b]Capture device problem with JMF[/b]

    Hi,
    I am doing audio and video transmission using the AVTransmit2 program. This program is at the server side. When 1client requests a transmission, it works fine. I am able to receive the audio and video. But when i have more than 1client i get the error: "Capture device in use", "Cannot create data source". I have created 2 players to render the audio and video on the screen.
    Note: I am using an Object Request Broker(Visibroker) to route the client requests to the server and sending the replies back to the clients.
    Please help, it's urgent.
    For any reply e-mail me at: [email protected]
    Thanking you in advance.

    No, sorry. Haven't got an solutions yet........
    However messing around with the permissions and settings in etc/security/console.perms and /etc/udev/50-udev.rules is causing it to not work in root either.....so i think it has something to do with it. However not figured it out yet.
    But these files and setting do not apply to windows.....
    Does anybody hav a solutions for the problem?
    Greeting,
    Olly

  • Capture device screen

    Hi all,
    We need to capture device screen using j2me,similar to Print Scrn key of keyboard.
    can any one help me to do this???
    thanks in advance
    m.raj

    Does the Displayable you want to capture extend Canvas? If so, you could create a mutable image and invoke the paint(...) method with the Graphics context of the image.
    If you're talking about capturing a screen that isn't part of your MIDlet application, AFAIK that can't be done (and shouldn't be allowed).
    db

  • JMF device in use

    Hi guys I'm developing a desktop application with jmf and a web cam, the main problem is when I open for the first time it work ok but when I close and open the form it throws an exception java.io.IOException: Capture device in use so I want to know how to fix this error
    thank you for your time.

    Maybe you're not releasing the resource correctly after use.

  • Transmitting and playing from same capture device simultaneously?

    I am creating a videoconference software. For that I need to display the video from my system and at the same time need to transmit the video to a remote system.
    I have no idea how to do this. I have created a data source for the capturing device and using that for creating player and processor to play and transmit respectively.
    But the problem is the player is stoping when the video is getting transmitted.
    Can some one tell me how can I solve this problem.
    Thanking you in advance,
    R.Ravi Kiran

    Maybe cloning can do some
    Or manually drop data from datasource to each module

  • Use a capture device twice at the same time?

    I have write a application using JMF. But I have a big question that how can I use a capture device several times at the same time????
    For example:
    I create a player to play video from my webcam on my PC ,and then I want to send the video stream from my webcam to another PC at the same time. But I failed--only one task can work.
    For example:
    1, I write a class Player and another class RTPTransmit. Then I send the same medialocator to two of them. Then there will be a exception said that capture device is in use. And only one task can work.
    2, I write a class Player and another class RTPTransmit. Then I use :
    dataSource1 = Manager.createDataSource( locator );
    dataSource2 = Manager.createCloneableDataSource( dataSource1 );
    then I send dataSource1 to Player object to play video on local PC and send dataSource2 to RTPTransmit to send video to another PC. But only one task will work too.
    My question is that how can I use a capture device several times at the same time???
    I have tried several ways and sill can not find a method. If anyone know how to do,could you tell me please? Thank you very much.

    Yes ,I use Manager.createCloneableDataSource() method to create the clone of the datasource ,but it can not work too. The java doc illustration is :
    Creates a cloneable DataSource. The returned DataSource implements the SourceCloneable interface and enables the creation of clones by the createClone method.
    If the input DataSource implements SourceCloneable, it will be returned right away as the result. Otherwise, a "proxy" DataSource is created. It implements the SourceCloneable interface and can be used to generate other clones.
    When createCloneableDataSource is called on a DataSource, the returned DataSource should be used in place of the original DataSource. Any attempt to use the original DataSource may generate unpredictable results.
    It means that if I clone a datasoure from original datasource, then the createCloneableDataSource() method will return a datasuouce implements interface SourceCloneable, right ? I see that the intereface SourceCloneable has a abstract method createClone() , but when I use createCloneableDataSource() to get a source clone, I find that I can not use method createClone(), why??? For example: data1 is the
    orginal datasource. Then:
    DataSource data1 = Manager.createDateSource( locator );
    DataSource data2 = Manager.createCloneableDataSource( data1 );
    now data2 is the "proxy" datasource which implemnets the interface, right? But I can not use data2.cloneClone() ,why? Then I write the fllowing code:
    DataSource data3 = Mangaer.createCloneableDataSource( data2 );
    DataSource data4 = Manager.createCloneableDataSource( data2 );
    playOnLocalPc = new PlayOnLocalPc( data3 );
    playOnLocalPc.start();
    rtpTransmit = new RTPTransmit( data4 );
    rtpTransmit.start();
    PlayOnLocalPc and RTPTransmit is my own class to play or transmit video stream. But they can not work at the same time. If I play video from webcam on local PC and then start to transmit stream to other PC , the play window will become black. Why?????It is too strange. Dose anyone know the reason ,please tell me, thank you very much. Giving some example code will be better:) Thank you again!

  • After using video capture device to copy VHS to DVD, burnt DVD will play on computer but not

    After using video capture device to copy VHS to DVD, burnt DVD will play on computer but not on DVD player. Tech support for the VCD said my HP DVD burning software has to burn "DVD Video and not DVD data" and to check with HP. How can i check myself.

    Grahamster, welcome to the forum.
    I recommend trying CDBurnerXP for burning video CD's.  I have been using it for years without a glitch.  I use it mainly for burning ISO's, but have used it for all types.  Please let us know if it works or not.
    Signature:
    HP TouchPad - 1.2 GHz; 1 GB memory; 32 GB storage; WebOS/CyanogenMod 11(Kit Kat)
    HP 10 Plus; Android-Kit Kat; 1.0 GHz Allwinner A31 ARM Cortex A7 Quad Core Processor ; 2GB RAM Memory Long: 2 GB DDR3L SDRAM (1600MHz); 16GB disable eMMC 16GB v4.51
    HP Omen; i7-4710QH; 8 GB memory; 256 GB San Disk SSD; Win 8.1
    HP Photosmart 7520 AIO
    ++++++++++++++++++
    **Click the Thumbs Up+ to say 'Thanks' and the 'Accept as Solution' if I have solved your problem.**
    Intelligence is God given; Wisdom is the sum of our mistakes!
    I am not an HP employee.

  • JMF capture device already in use

    Hi,
    I'm trying to make something like VI or Netmeeting with JMF. The problem is that i can't send over RTP and have a Player with the same MediaLocator.
    error : ...Capture device already in use...
    Does anybody know how to send and play the same media at the same time

    If I send to unicast address ? I wanna find a possibility to use the same medialocator or the same datasource for example. It tell me that the capture device is already in use. How can I capture and send at same time. For example, how can you see wath you're sending with Videotransmit from java.sun.
    Tanks

Maybe you are looking for