greeninho / javacv

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

When I use "new FFmpegFrameRecorder" instead of "FFmpegFrameRecorder.creatDefault", the Exception occur. #251

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.as title
2.
3.

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

Exception in thread "main" java.lang.UnsatisfiedLinkError: 
C:\Users\xXx\AppData\Local\Temp\javacpp147168048693823\jniavutil.dll: Can't 
find dependent libraries
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary1(Unknown Source)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.load0(Unknown Source)
    at java.lang.System.load(Unknown Source)
    at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:418)
    at com.googlecode.javacpp.Loader.load(Loader.java:368)
    at com.googlecode.javacpp.Loader.load(Loader.java:315)
    at com.googlecode.javacv.cpp.avutil.<clinit>(avutil.java:75)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at com.googlecode.javacpp.Loader.load(Loader.java:334)
    at com.googlecode.javacv.cpp.avcodec.<clinit>(avcodec.java:85)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at com.googlecode.javacpp.Loader.load(Loader.java:334)
    at com.googlecode.javacv.cpp.avformat.<clinit>(avformat.java:76)
    at com.googlecode.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:111)
    at com.googlecode.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:104)
    at Test.CameraRecord.CameraTest.main(CameraTest.java:26)

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

Javacv0.2 & Opencv2.4.2 windows 64bit

Please provide any additional information below.

It's my code

I fallow "http://code.google.com/p/javacv/wiki/Windows7AndOpenCV", but 
Exception occur in same way.

I want to produce the "mp4" or "flv" which are smaller than "avi", I
use 

"FrameRecorder recorder = 
 FFmpegFrameRecorder.createDefault("output.avi",  grabbedImage.width(), grabbedImage.height());"

successfully in the beginning. Unfortunately, when I wnat to output "mp4" or 
"flv", the exception occur.

Please help me!!!! TY

btw : I can't find "recorder.setCodecId()" when I search old issues,
      Is it be deleted in the new version? 

////////////////////////////////////////////////////
public class CameraTest {

    public static void main(String[] args) throws Exception {
        OpenCVFrameGrabber grabber = new OpenCVFrameGrabber(0);
        grabber.start();
        IplImage grabbedImage = grabber.grab();

        CanvasFrame canvasFrame = new CanvasFrame("Cam");
        canvasFrame.setCanvasSize(grabbedImage.width(), grabbedImage.height());

        System.out.println("framerate = " + grabber.getFrameRate());
        grabber.setFrameRate(grabber.getFrameRate());
        FrameRecorder recorder = new FFmpegFrameRecorder("output.mp4",  grabbedImage.width(), grabbedImage.height());
        recorder.setFrameRate(grabber.getFrameRate());
        recorder.setSampleFormat(grabber.getSampleFormat());
        recorder.setSampleRate(grabber.getSampleRate()); 
        recorder.start();
        while (canvasFrame.isVisible() && (grabbedImage = grabber.grab()) != null) {
            canvasFrame.showImage(grabbedImage);
            recorder.record(grabbedImage);
        }
        recorder.stop();
        grabber.stop();
        canvasFrame.dispose();
    }
}
///////////////////////////////////////////////////

Original issue reported on code.google.com by meteora9...@gmail.com on 18 Oct 2012 at 12:42

GoogleCodeExporter commented 8 years ago
Did you install the FFmpeg DLLs as instructed in the README.txt file?

Original comment by samuel.a...@gmail.com on 18 Oct 2012 at 1:15

GoogleCodeExporter commented 8 years ago
Is that put the "ffmpeg-20121010-git-1a104bf-win64-shared\bin" all DLLS in 
System32 files for installation of FFmpeg ?

Original comment by meteora9...@gmail.com on 18 Oct 2012 at 3:28

GoogleCodeExporter commented 8 years ago
if I do this, the fallowed error will occur.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006a55d246, pid=11920, 
tid=5024
#
# JRE version: 7.0_09-b05
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.5-b02 mixed mode windows-amd64 
compressed oops)
# Problematic frame:
# C  [avcodec-54.dll+0x49d246]  avcodec_encode_audio2+0x16
#
# Failed to write core dump. Minidumps are not enabled by default on client 
versions of Windows
#
# An error report file with more information is saved as:
# C:\workspace\TestRecord\hs_err_pid11920.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.

Original comment by meteora9...@gmail.com on 18 Oct 2012 at 6:36

GoogleCodeExporter commented 8 years ago
You should try with the latest source code, a lot has changed, or you could 
wait for the next release that I'm planning to do when OpenCV 2.4.3 comes out...

Original comment by samuel.a...@gmail.com on 20 Oct 2012 at 1:01

GoogleCodeExporter commented 8 years ago
This should all be fixed with JavaCV 0.3, so please upgrade, and let me know if 
you still have issues, thanks!

Original comment by samuel.a...@gmail.com on 5 Nov 2012 at 11:39

GoogleCodeExporter commented 8 years ago
how do i used javacv help me out on this

Original comment by angeldel...@gmail.com on 20 Nov 2012 at 10:31

GoogleCodeExporter commented 8 years ago
@angeldelusion28, please read the README.txt file and please post your 
questions on the mailing list, thank you!

Original comment by samuel.a...@gmail.com on 21 Nov 2012 at 1:52

GoogleCodeExporter commented 8 years ago
there is no jniavutil.dll in any package of ffmpeg

Original comment by Holde...@gmail.com on 11 Jan 2013 at 5:11