artclarke / humble-video

Humble Video: Demuxing, Decoding, Filtering, Encoding and Muxing of 100's of video and audio formats and Codecs from the JVM
GNU Affero General Public License v3.0
551 stars 113 forks source link

Error Can't load IA 32-bit .dll on a AMD 64-bit platform io.humble.ferry.JNILibrary #109

Open jpalumbo1981 opened 7 years ago

jpalumbo1981 commented 7 years ago

Hi budy, how are you? i have a couple day trying to make work io-humble library, and i have to tell you, its make me crazy. i cant find a right way to do it. Every time i try, i get the next error message.

Honestly, i cant figure out the solution. I'm working on a pc under windows 10. Please, can you help me with this?

`public class ReordVideo {

public static void record(String file, Rectangle screenbounds, int duration) {
    new Thread(() -> {
        try {
            final Robot robot = new Robot();

            final Muxer muxer = Muxer.make(file, null, "mpegts");
            final MuxerFormat format = muxer.getFormat();
            final Codec codec = Codec.findEncodingCodec(format.getDefaultVideoCodecId());
            Encoder encoder = Encoder.make(codec);
            encoder.setWidth(screenbounds.width);
            encoder.setHeight(screenbounds.height);
            final PixelFormat.Type pixelformat = PixelFormat.Type.PIX_FMT_YUV420P;
            encoder.setPixelFormat(pixelformat);
            encoder.setTimeBase(Rational.make(1, 10)); //framerate
            if (format.getFlag(MuxerFormat.Flag.RAW_PICTURE)) {
                encoder.setFlag(Encoder.Flag.FLAG_GLOBAL_HEADER, true);
            }
            encoder.open(null, null);
            muxer.addNewStream(encoder);
            muxer.open(null, null);
            MediaPictureConverter converter = null;
            final MediaPicture picture = MediaPicture.make(
                    encoder.getWidth(),
                    encoder.getHeight(),
                    pixelformat);
            picture.setTimeBase(encoder.getTimeBase());
            final MediaPacket packet = MediaPacket.make();
            for (int i = 0; i < duration / encoder.getTimeBase().getDouble(); i++) {
                final BufferedImage screen
                        = convertToType(robot.createScreenCapture(screenbounds),
                                BufferedImage.TYPE_3BYTE_BGR);
                if (converter == null) {
                    converter = MediaPictureConverterFactory.createConverter(screen, picture);
                }
                converter.toPicture(picture, screen, i);
                do {
                    encoder.encode(packet, picture);
                    if (packet.isComplete()) {
                        muxer.write(packet, false);
                    }
                } while (packet.isComplete());
                Thread.sleep((long) (1000 * encoder.getTimeBase().getDouble()));
                do {
                    encoder.encode(packet, null);
                    if (packet.isComplete()) {
                        muxer.write(packet, false);
                    }
                } while (packet.isComplete());
                muxer.close();
            }
        } catch (AWTException | InterruptedException | IOException ex) {
            Logger.getLogger(ReordVideo.class.getName()).log(Level.SEVERE, null, ex);
        }
   }).start();
}

}`

Humble Version: Class: io.humble.video_native.Version; Specification Vendor: Humble Software; Specification Title: humble-video-arch-i686-w64-mingw32; Specification Version: 0.2.1; Implementation Vendor: Humble Software; Implementation Title: humble-video-arch-i686-w64-mingw32; Implementation Version: 0.2.1; 07:45:50.211 [Thread-44] DEBUG io.humble.ferry.JNILibrary - Failure: library load of library: humblevideo; url: C:\Users\JOSEAN~1\AppData\Local\Temp\humble8103148009760715820.dll; error: {} java.lang.UnsatisfiedLinkError: C:\Users\JoseAntonio\AppData\Local\Temp\humble8103148009760715820.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1937) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1822) at java.lang.Runtime.load0(Runtime.java:809) at java.lang.System.load(System.java:1086) at io.humble.ferry.JNILibrary.doJNILoad(JNILibrary.java:203) at io.humble.ferry.JNILibrary.unpackLibrary(JNILibrary.java:287) at io.humble.ferry.JNILibrary.loadFromClasspath(JNILibrary.java:189) at io.humble.ferry.JNILibrary.load(JNILibrary.java:168) at io.humble.ferry.JNILibrary.load(JNILibrary.java:149) at io.humble.ferry.FerryJNI.(FerryJNI.java:16) at io.humble.ferry.Ferry.(Ferry.java:24) at io.humble.video.VideoJNI.(VideoJNI.java:19) at io.humble.video.Muxer.make(Muxer.java:139) at com.plogging.serengeti.ReordVideo.lambda$record$0(ReordVideo.java:39) at com.plogging.serengeti.ReordVideo$$Lambda$20/960707500.run(Unknown Source) at java.lang.Thread.run(Thread.java:745) Qt: Untested Windows version 6.3 detected! Qt: Untested Windows version 6.3 detected! 07:46:10.435 [Thread-44] ERROR io.humble.video.Encoder - HumbleRuntimeError("Cannot add data to an encoder after you passed in null; encoder is flushing"): Cannot add data to an encoder after you passed in null; encoder is flushing (Encoder.cpp:258) Exception in thread "Thread-44" java.lang.RuntimeException: Cannot add data to an encoder after you passed in null; encoder is flushing at io.humble.video.VideoJNI.Encoder_encode(Native Method) at io.humble.video.Encoder.encode(Encoder.java:248) at com.plogging.serengeti.ReordVideo.lambda$record$0(ReordVideo.java:70) at com.plogging.serengeti.ReordVideo$$Lambda$20/960707500.run(Unknown Source) at java.lang.Thread.run(Thread.java:745)

cqjjjzr commented 7 years ago

obviously, the library can't find the correct dll to load. don't know the solution, try ask art.

jpalumbo1981 commented 7 years ago

i'm working in a maven project (java) using just official repo

osenbghe commented 7 years ago

Could be a JavaVM Issue. Java Version 1.8.131 fires this error on 64Bit Java Version 1.8.92 (under 100 on the last digit) runs fine without this type of error on 64Bit

huhlig commented 6 years ago

Experiencing same issue with Java(TM) SE Runtime Environment (build 1.8.0_131-b11) JDK

ghost commented 6 years ago

I've solved this error by excluding arch artifacts for other platforms, so snippet from my pom.xml:

io.humble humble-video-all 0.2.1 io.humble humble-video-arch-i686-apple-darwin12 ... humble-video-arch-x86_64-apple-darwin12 ... humble-video-arch-i686-pc-linux-gnu6 ... humble-video-arch-x86_64-pc-linux-gnu6 ... humble-video-arch-i686-w64-mingw32
huhlig commented 6 years ago

That's the same temporary work around I found.

Hans W. Uhlig - huhlig@gmail.com PGP Key: F509CF9D892BDBE8 PGP Fingerprint: 74AF EDD7 7427 3288 45AB 6FCB F509 CF9D 892B DBE8

On Wed, Sep 6, 2017 at 4:14 AM, Maksim S notifications@github.com wrote:

I've solved this error by excluding arch artifacts for other platforms, so snippet from my pom.xml:

io.humble humble-video-all 0.2.1

io.humble humble-video-arch-i686-apple-darwin12

... humble-video-arch-x86_64-apple-darwin12 ... humble-video-arch-i686-pc-linux-gnu6 ... humble-video-arch-x86_64-pc-linux-gnu6 ... humble-video-arch-i686-w64-mingw32

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/artclarke/humble-video/issues/109#issuecomment-327452382, or mute the thread https://github.com/notifications/unsubscribe-auth/AACarKaEkpkVa_phyN2qewjnODc070Ibks5sfn6bgaJpZM4NpQOi .

SeunMatt commented 5 years ago

This is for anybody coming here later. This worked for me on a Windows 10 64-bit system:

<dependency>
            <groupId>io.humble</groupId>
            <artifactId>humble-video-all</artifactId>
            <version>0.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>io.humble</groupId>
                    <artifactId>humble-video-arch-x86_64-apple-darwin12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.humble</groupId>
                    <artifactId>humble-video-arch-i686-pc-linux-gnu6</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.humble</groupId>
                    <artifactId>humble-video-arch-x86_64-pc-linux-gnu6</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.humble</groupId>
                    <artifactId>humble-video-arch-i686-apple-darwin12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.humble</groupId>
                    <artifactId>humble-video-arch-i686-w64-mingw32</artifactId>
                </exclusion>
            </exclusions>
        </dependency>