AWS Kinesis Video Streams - 生产者 SDK Java - JNI 异常
AWS Kinesis Video Streams - Producer SDK Java - JNI Exception
我想从我的网络摄像头流式传输到 Kinesis Video Streams。
我一直在阅读 documentation and following the AWS tutorials。
使用以下命令启动 DemoAppMain 后:
java -classpath target/amazon-kinesis-video-streams-producer-sdk-java-1.11.0-jar-with-dependencies.jar "-Daws.accessKeyId=fake_accessKeyID -Daws.secretKey=fake_secretKey -Dkvs-stream=fake_streamName -Djava.library.path=src\main\resources\lib\windows\KinesisVideoProducerJNI.dll" com.amazonaws.kinesisvideo.demoapp.DemoAppMain
我得到以下异常:
DEBUG / KinesisVideo: Unsatisfied link error. Directly loading native library .so.
DEBUG / KinesisVideo: Unsatisfied link error. Directly loading native library .dylib.
DEBUG / KinesisVideo: Unsatisfied link error. Directly loading native library .dll.
DEBUG / KinesisVideo: Unsatisfied link error. Directly loading native library libKinesisVideoProducerJNI.so.
DEBUG / KinesisVideo: Unsatisfied link error. Directly loading native library libKinesisVideoProducerJNI.dylib.
DEBUG / KinesisVideo: Unsatisfied link error. Directly loading native library libKinesisVideoProducerJNI.dll.
ERROR / KinesisVideo: 2021-10-18T10:50Z T1: EXCEPTION: UnsatisfiedLinkError: Unsatisfied link error. Loading native library KinesisVideoProducerJNI failed with java.lang.UnsatisfiedLinkError: no KinesisVideoProducerJNI in java.library.path: ...
Exception in thread "main" java.lang.RuntimeException: com.amazonaws.kinesisvideo.producer.ProducerException: Failed loading native library StatusCode: 0xd
at com.amazonaws.kinesisvideo.demoapp.DemoAppMain.main(DemoAppMain.java:60)
Caused by: com.amazonaws.kinesisvideo.producer.ProducerException: Failed loading native library StatusCode: 0xd
at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.initializeLibrary(NativeKinesisVideoProducerJni.java:1177)
at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.create(NativeKinesisVideoProducerJni.java:229)
at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.createSync(NativeKinesisVideoProducerJni.java:247)
at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.createSync(NativeKinesisVideoProducerJni.java:212)
at com.amazonaws.kinesisvideo.internal.client.NativeKinesisVideoClient.initializeNewKinesisVideoProducer(NativeKinesisVideoClient.java:238)
at com.amazonaws.kinesisvideo.internal.client.NativeKinesisVideoClient.initialize(NativeKinesisVideoClient.java:119)
at com.amazonaws.kinesisvideo.java.client.KinesisVideoJavaClientFactory.createKinesisVideoClient(KinesisVideoJavaClientFactory.java:113)
at com.amazonaws.kinesisvideo.java.client.KinesisVideoJavaClientFactory.createKinesisVideoClient(KinesisVideoJavaClientFactory.java:86)
at com.amazonaws.kinesisvideo.demoapp.DemoAppMain.main(DemoAppMain.java:42)
我在互联网上进行了研究,但没有成功。这就是我制作这个 post 的原因。
如果有人知道如何解决这个问题,我将不胜感激!
错误状态:
no KinesisVideoProducerJNI in java.library.path
您是如何准确地将此库添加到您的 class 路径中的?
文档说明了拥有此库的先决条件:
Your NativeLibraryPath must contain your KinesisVideoProducerJNI file, available at https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp
. The file name extension for this file depends on your operating system:
KinesisVideoProducerJNI.so for Linux
KinesisVideoProducerJNI.dylib for macOS
KinesisVideoProducerJNI.dll for Windows
如果您查看 windows 文件夹,该库存在于该文件夹中:
也许这样做会奏效:
-Djava.library.path=src/main/resources/lib/windows <-- The Directory!
java -classpath target/amazon-kinesis-video-streams-producer-sdk-java-1.11.0-jar-with-dependencies.jar -Daws.accessKeyId= -Daws.secretKey= -Dkvs-stream= -Djava.library.path=src/main/resources/lib/windows com.amazonaws.kinesisvideo.demoapp.DemoAppMain
我想从我的网络摄像头流式传输到 Kinesis Video Streams。 我一直在阅读 documentation and following the AWS tutorials。 使用以下命令启动 DemoAppMain 后:
java -classpath target/amazon-kinesis-video-streams-producer-sdk-java-1.11.0-jar-with-dependencies.jar "-Daws.accessKeyId=fake_accessKeyID -Daws.secretKey=fake_secretKey -Dkvs-stream=fake_streamName -Djava.library.path=src\main\resources\lib\windows\KinesisVideoProducerJNI.dll" com.amazonaws.kinesisvideo.demoapp.DemoAppMain
我得到以下异常:
DEBUG / KinesisVideo: Unsatisfied link error. Directly loading native library .so.
DEBUG / KinesisVideo: Unsatisfied link error. Directly loading native library .dylib.
DEBUG / KinesisVideo: Unsatisfied link error. Directly loading native library .dll.
DEBUG / KinesisVideo: Unsatisfied link error. Directly loading native library libKinesisVideoProducerJNI.so.
DEBUG / KinesisVideo: Unsatisfied link error. Directly loading native library libKinesisVideoProducerJNI.dylib.
DEBUG / KinesisVideo: Unsatisfied link error. Directly loading native library libKinesisVideoProducerJNI.dll.
ERROR / KinesisVideo: 2021-10-18T10:50Z T1: EXCEPTION: UnsatisfiedLinkError: Unsatisfied link error. Loading native library KinesisVideoProducerJNI failed with java.lang.UnsatisfiedLinkError: no KinesisVideoProducerJNI in java.library.path: ...
Exception in thread "main" java.lang.RuntimeException: com.amazonaws.kinesisvideo.producer.ProducerException: Failed loading native library StatusCode: 0xd
at com.amazonaws.kinesisvideo.demoapp.DemoAppMain.main(DemoAppMain.java:60)
Caused by: com.amazonaws.kinesisvideo.producer.ProducerException: Failed loading native library StatusCode: 0xd
at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.initializeLibrary(NativeKinesisVideoProducerJni.java:1177)
at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.create(NativeKinesisVideoProducerJni.java:229)
at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.createSync(NativeKinesisVideoProducerJni.java:247)
at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.createSync(NativeKinesisVideoProducerJni.java:212)
at com.amazonaws.kinesisvideo.internal.client.NativeKinesisVideoClient.initializeNewKinesisVideoProducer(NativeKinesisVideoClient.java:238)
at com.amazonaws.kinesisvideo.internal.client.NativeKinesisVideoClient.initialize(NativeKinesisVideoClient.java:119)
at com.amazonaws.kinesisvideo.java.client.KinesisVideoJavaClientFactory.createKinesisVideoClient(KinesisVideoJavaClientFactory.java:113)
at com.amazonaws.kinesisvideo.java.client.KinesisVideoJavaClientFactory.createKinesisVideoClient(KinesisVideoJavaClientFactory.java:86)
at com.amazonaws.kinesisvideo.demoapp.DemoAppMain.main(DemoAppMain.java:42)
我在互联网上进行了研究,但没有成功。这就是我制作这个 post 的原因。 如果有人知道如何解决这个问题,我将不胜感激!
错误状态:
no KinesisVideoProducerJNI in java.library.path
您是如何准确地将此库添加到您的 class 路径中的?
文档说明了拥有此库的先决条件:
Your NativeLibraryPath must contain your KinesisVideoProducerJNI file, available at https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp
. The file name extension for this file depends on your operating system:
KinesisVideoProducerJNI.so for Linux
KinesisVideoProducerJNI.dylib for macOS
KinesisVideoProducerJNI.dll for Windows
如果您查看 windows 文件夹,该库存在于该文件夹中:
也许这样做会奏效:
-Djava.library.path=src/main/resources/lib/windows <-- The Directory!
java -classpath target/amazon-kinesis-video-streams-producer-sdk-java-1.11.0-jar-with-dependencies.jar -Daws.accessKeyId=