简体   繁体   中英

Onvif java or javacv recording video to file from RTSP?

From the camera direct streaming is possible and can display it as well, but not write to a video file any format will do. But from rtsp we get frames by frames and i would like to develop without any more external librarys apart from opencv or javacv if possible. and in opencv-java videoWriter is missing( here ) so unable to capture video to a file.

In javacv was unable to create a stream or a recorder from rtsp. case:

FrameGrabber grabber = new FFmpegFrameGrabber("rtsp://1ink..."); FrameRecorder fr = new FFmpegFrameRecorder("rtsp://linkf", 0);

Error is :

java.lang.UnsatisfiedLinkError: no jniavcodec in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1119) at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535) at org.bytedeco.javacpp.Loader.load(Loader.java:410) at org.bytedeco.javacpp.Loader.load(Loader.java:353) at org.bytedeco.javacpp.avcodec.(avcodec.java:12) at org.bytedeco.javacv.FFmpegFrameGrabber.(FFmpegFrameGrabber.java:103)

in both case The rtsp link is working as i get photos from the camera.

Thanks in advance.

Found the issue. If any one will be helpfull with it.

In javacv if any one has the following error

java.lang.UnsatisfiedLinkError: no jniavcodec in java.library.path

do add

Class.forName("org.bytedeco.javacpp.swresample");

Rest will work fine. All the best.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM