bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.59k stars 1.59k forks source link

FFmpegFrameRecorder - Could not initialize class org.bytedeco.javacpp.avutil #429

Closed guylevin closed 8 years ago

guylevin commented 8 years ago

Hello, I get Could not initialize class org.bytedeco.javacpp.avutil when when trying to use FFmpegFrameRecorder

I've looked everywhere and tried the solutions found on this form, couldn't make it work

Will be grateful if somebody has an answer

Using Windows + Eclipse + Maven JavaCV - Version 1.2

This line throws the exception: FFmpegFrameRecorder ffr = new FFmpegFrameRecorder("stream_url...",0);

And this is the stack:

Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.javacpp.avutil
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.bytedeco.javacpp.Loader.load(Loader.java:464)
    at org.bytedeco.javacpp.Loader.load(Loader.java:409)
    at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1559)
    at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)
    at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:120)
    at com.airobotics.aaaaaa.App.main(App.java:20)
Error putting member offsets for class org/bytedeco/javacpp/avutil$Pool_free_Pointer.

The pom looks like this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.airobotics.common</groupId>
    <artifactId>aaaaaa</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>aaaaaa</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>

        <dependency>
            <groupId>org.bytedeco</groupId>
            <artifactId>javacv</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>org.bytedeco.javacpp-presets</groupId>
            <artifactId>ffmpeg</artifactId>
            <version>3.0.2-1.2</version>
        </dependency>

        <dependency>
            <groupId>org.bytedeco.javacpp-presets</groupId>
            <artifactId>opencv</artifactId>
            <version>3.1.0-1.2</version>
        </dependency>

        <dependency>
            <groupId>org.bytedeco</groupId>
            <artifactId>javacpp</artifactId>
            <version>1.2</version>
        </dependency>

    </dependencies>
</project>
guylevin commented 8 years ago

After a day spent around this, I moved to version 1.1 and everything seems to work fine.

saudet commented 8 years ago

Duplicate of https://github.com/bytedeco/javacpp-presets/issues/225

springCoders commented 7 years ago

spring tool suite, linux, war file http://stackoverflow.com/questions/43116353/opencv-java-error-loading-class-org-bytedeco-javacpp-loader-snapshot-from-video

skykuns commented 3 years ago

After a day spent around this, I moved to version 1.1 and everything seems to work fine.

It is works , thanks!