开发者

How to make video in Java captured from webcam through lti-Civil CaptureDeviceStream?

Can I do it only with the lti-Civil classes or I need FMJ or JMF ? do I use the actual Stream or set of captured Images from CaptureObserver?

Thanks.


    captureStream = system.openCaptureDeviceStream(info.getDeviceID());
            captureStream.setObserver(new CaptureObserver(){

                public void onError(CaptureStream arg0, CaptureException arg1) {
                }

                public void onNewImage(CaptureStream streamSource, Image image) {
                    try
                    {
                        imageFrame.setImage(AWTImageConverter.toBufferedImage(image));
                        bufferedImage = AWTImageConverter.toBufferedImage(image);
                    }
                    catch (Throwable t)
                    {   t.printStackTrace(); }

                }

开发者_如何转开发            });
captureStream.start();


If I understand your question correctly, the introduction on Lti-civil site have the answer:

LTI-CIVIL is a Java library for capturing images from a video source such as a USB camera. It provides a simple API and does not depend on or use JMF! The FMJ project integrates LTI CIVIL into the JMF architecture by providing a civil: datasource. For more information, visit screenshots and project status sections of this website

As far as I can see your code is not using any JMF specific classes so the above code should work with plain LTI-CIVIL.

EDIT:

Based on your clarification, I think you will need additional support for encoding the video as LTI-CIVIL seems to be focused solely on capturing. Out of FMJ and JMF, FMJ is probably a better choice as JMF's development appears to be ceased. For other alternatives see this section of wikipedia article about JMF

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜