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 8535063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:20:37+00:00 2026-06-11T10:20:37+00:00

It would be great if I could get advice on my problem: I am

  • 0

It would be great if I could get advice on my problem: I am working with an application that should show the user a list of attached PC cameras. For example, using my notebook I have one built-in web camera and one USB camera. When running the application, the user should be able to select the desired device and create a photo with it.

I have worked with this issue for several days and researched using the following existing frameworks: JMF, FMJ, VLCJ, Xuggler, JMyron, JavaFX, JavaCV.

Some of them have been deprecated; others requires installation of the SDK for each client PC. The main requirement of my application is portability, however, and that makes me wearing of using external SDK’s.

Is it possible to complete this task using only Java?

Right now my application should work only on Windows OS.

So, could I please have some advice on how to solve my problem?

Regards, Evgeniy

  • 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-11T10:20:38+00:00Added an answer on June 11, 2026 at 10:20 am

    I’m sorry that I posted the question so early. I’ve just resolved this problem. I used LTI-CIVIL. It has not been updated for 5 years… Anyway, it works fine for all my web camers. I have changed a bit one of the usage examples to switch between existing devices.
    Here is my code:

        public class CaptureFrame extends ImageFrame
    {
    private Map <String, String>cams = new HashMap<String, String>();
    public static void main(String[] args) throws CaptureException
    {
        new CaptureFrame(DefaultCaptureSystemFactorySingleton.instance()).run();
    }
    
    private CaptureSystem system;
    private CaptureStream captureStream;
    private final CaptureSystemFactory factory;
    private volatile boolean disposing = false;
    
    public CaptureFrame(CaptureSystemFactory factory)
    {   
        super("LTI-CIVIL");
        this.factory = factory;
    }
    
    public void run() throws CaptureException
    {
        initCapture();
    
        setLocation(200, 200);
        addWindowListener(new WindowAdapter()
        {
            public void windowClosing(WindowEvent e)
            {
                try
                {
                    disposeCapture();
                } catch (CaptureException e1)
                {
                    e1.printStackTrace();
                }
                System.exit(0);
            }
        });
        setVisible(true);
        pack();
    
        system = factory.createCaptureSystem();
        system.init();
        List <CaptureDeviceInfo>list = system.getCaptureDeviceInfoList();
        String[] possibilities = new String[list.size()];
        int i=0;
        for (CaptureDeviceInfo info : list){
            possibilities[i] = info.getDescription();
            cams.put(info.getDescription(), info.getDeviceID());
            i++;
        }
        String s = (String) JOptionPane.showInputDialog(
                this,
                "Please, choose needed web camera:\n",
                "Select one...",
                JOptionPane.PLAIN_MESSAGE,
                null,
                possibilities, null);
        captureStream = system.openCaptureDeviceStream(cams.get(s));
        captureStream.setObserver(new MyCaptureObserver());
        setSize(captureStream.getVideoFormat().getWidth(), captureStream.getVideoFormat().getHeight());
        startCapture();
    }
    
    
    
    public void initCapture() throws CaptureException
    {
        system = factory.createCaptureSystem();
        system.init();
    }
    
    public void startCapture() throws CaptureException
    {
        captureStream.start();
    }
    
    public void disposeCapture() throws CaptureException
    {
        disposing = true;
        if (captureStream != null)
        {   System.out.println("disposeCapture: stopping capture stream...");
            captureStream.stop();
            System.out.println("disposeCapture: stopped capture stream.");
            captureStream.dispose();
            captureStream = null;
        }
        if (system != null)
            system.dispose();
        System.out.println("disposeCapture done.");
    }
    
    class MyCaptureObserver implements CaptureObserver
    {
        public void onError(CaptureStream sender, CaptureException e)
        {   
            e.printStackTrace();
        }
    
        public void onNewImage(CaptureStream sender, com.lti.civil.Image image)
        {   
            if (disposing)
                return;
            try
            {
                setImage(AWTImageConverter.toBufferedImage(image));
            }
            catch (Throwable t)
            {   t.printStackTrace();
            }
        }
    }
    }
    

    Also the size of my project is only about 3 MB with all .dll libraries for Windows OS

    I hope it would help somebody.

    Regards, Evgeniy

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

Sidebar

Related Questions

Would be great to get some direction re trying to use sqlite for my
Im working on a java application that involves threads. So i just wrote a
Good Afternoon Fellas, A little advice would be appreciated, I'm approaching a problem by
While editing .scm files it would be great if Vim would automatically put the
I am pretty new to Patterns and some help would be great. I am
I created a simple .NET COM activex and it would be great if it
A simple answer to this super simple question would be great! Here is the
I am very fond of xmonad, but one thing would be great: If I
I am not sure what I am doing wrong, It would be great if
I have just started coding in AS3 and it would be really great to

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.