CubieBoard中文论坛

 找回密码
 立即注册
搜索
热搜: unable
查看: 5905|回复: 1

cb2使用webcam+v4l4j驱动出错

[复制链接]
发表于 2014-7-12 20:46:53 | 显示全部楼层 |阅读模式
使用oracle jdk8 for arm。

pc上执行没问题,但是在cb2上执行出现如下错误。

root@cubieboard2:/usr/pic4# sh run.sh
Java HotSpot(TM) Client VM warning: You have loaded library /usr/pic4/libbridj.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/libs3835851625471576394/libvideo.so: /tmp/libs3835851625471576394/libvideo.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1847)
        at java.lang.Runtime.loadLibrary0(Runtime.java:870)
        at java.lang.System.loadLibrary(System.java:1119)
        at au.edu.jcu.v4l4j.NativeUtils.loadLibraryFromJar(NativeUtils.java:98)
        at au.edu.jcu.v4l4j.V4L4J.init(V4L4J.java:16)
        at com.github.sarxos.webcam.ds.v4l4j.V4l4jDriver.<clinit>(V4l4jDriver.java:36)
        at com.can.webcam.TestCam.main(TestCam.java:20)


运行脚本是:
CLASSPATH=$CLASSPATH:./bridj-0.6.3-20130316.190111-13.jar:./kwebcam.jar:./v4l4j-0.9-WC.jar:./slf4j-api-1.7.2.jar:./webcam-capture-0.3.10-RC7.jar:./webcam-capture-driver-jmf-0.3.10-RC7.jar:./webcam-capture-driver-v4l4j-0.3.10-RC7.jar:./slf4j-nop-1.7.7.jar:.:
java  com.can.webcam.TestCam

测试类:

package com.can.webcam;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

import com.github.sarxos.webcam.Webcam;
import com.github.sarxos.webcam.ds.v4l4j.V4l4jDriver;

public class TestCam {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // get default webcam and open it
        Webcam webcam = Webcam.getDefault();
       Webcam.setDriver(new V4l4jDriver());
        webcam.open();

        // get image
        BufferedImage image = webcam.getImage();

        // save image to PNG file
        try {
            ImageIO.write(image, "PNG", new File("test.png"));
            ImageIO.write(image, "PNG", new File("/var/test.png"));
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }
    public static void getPic() {
        // get default webcam and open it
        Webcam webcam = Webcam.getDefault();
        webcam.open();

        // get image
        BufferedImage image = webcam.getImage();

        // save image to PNG file
        try {
            ImageIO.write(image, "PNG", new File("test.png"));
            ImageIO.write(image, "PNG", new File("/var/lib/tomcat6/webapps/ROOT/test.png"));
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }
}
回复

使用道具 举报

发表于 2014-7-14 11:33:22 | 显示全部楼层
楼主,请教个问题,已经安装ubuntu系统的板子还能进行程序裸跑的工作吗?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|粤ICP备13051116号|cubie.cc---深刻的嵌入式技术讨论社区

GMT+8, 2024-11-23 05:34 , Processed in 0.023913 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2012 Comsenz Inc. | Style by Coxxs

返回顶部