garry18 / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

java.lang.UnsatisfiedLinkError while trying to merge two videos. #458

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. merging two mp4 videos using 

What is the expected output? What do you see instead?

the code works fine on android devices,but now i'm trying to merge the videos 
in normal java project so that i put the code on a server and get the output 
video from it.

What version of the product are you using? On what operating system?

i'v include this jars to my java project:

ffmpeg-2.1.1-windows-x86_64.jar
javacpp.jar
javacv.jar
javacv-windows-x86_64.jar
opencv-2.4.8-windows-x86_64.jar

Please provide any additional information below.

i keep getting this error 

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniavcodec in 
java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:711)
    at com.googlecode.javacpp.Loader.load(Loader.java:586)
    at com.googlecode.javacpp.Loader.load(Loader.java:540)
    at com.googlecode.javacv.cpp.avcodec.<clinit>(avcodec.java:39)
    at com.googlecode.javacv.FFmpegFrameGrabber.<clinit>(FFmpegFrameGrabber.java:103)
    at MergingApp.Merge(MergingApp.java:14)
    at MergingApp.main(MergingApp.java:40)
Caused by: java.lang.UnsatisfiedLinkError: no avcodec in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:711)
    at com.googlecode.javacpp.Loader.load(Loader.java:577)
    ... 5 more

Original issue reported on code.google.com by Moh.Na...@gmail.com on 11 Apr 2014 at 3:13

GoogleCodeExporter commented 8 years ago
oh i almost forgot , my OS is win 8 and here's the code 
FrameGrabber grabber1 = new FFmpegFrameGrabber("Fifteen.mp4");
        grabber1.start();
        FrameGrabber grabber2 = new FFmpegFrameGrabber("Six.mp4");
        grabber2.start();
        FrameRecorder recorder = new FFmpegFrameRecorder(
                "output.mp4",grabber1.getImageWidth(),grabber1.getImageHeight());
        try {
            recorder.start();
            Frame frame;
            while ((frame = grabber1.grabFrame()) != null) {
                recorder.record(frame);
            }
            while ((frame = grabber2.grabFrame()) != null) {
                recorder.record(frame);
            }
            recorder.stop();
            grabber2.stop();
            grabber1.stop();
        } catch (com.googlecode.javacv.FrameRecorder.Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

Original comment by Moh.Na...@gmail.com on 11 Apr 2014 at 3:17

GoogleCodeExporter commented 8 years ago
Please try to include the JAR files ending with "Windows-x86.jar" as well.

Original comment by samuel.a...@gmail.com on 11 Apr 2014 at 11:07

GoogleCodeExporter commented 8 years ago
i'v included 3 Jars of x86 and it finally works!! , thanks bro i was really 
desperate :)

Original comment by Moh.Na...@gmail.com on 13 Apr 2014 at 4:33

GoogleCodeExporter commented 8 years ago
sorry,one last question. can i merge more than two videos with it ?

Original comment by Moh.Na...@gmail.com on 13 Apr 2014 at 4:53

GoogleCodeExporter commented 8 years ago
Good to hear that! 

To merge a third video, add "FrameGrabber grabber3 = new 
FFmpegFrameGrabber(...)", and a fourth, etc. We can merge as many videos as one 
wishes. 

Please ask your questions on the mailing list next time if possible, thank you!

Original comment by samuel.a...@gmail.com on 29 Apr 2014 at 1:47