使用 aws Lambda 时无法加载 kinesis 本机库

unable to load kinesis native library when using aws Lambda

我正在尝试上传我使用 kinesis video streaming 的 lambda 函数 我可以在本地使用它,因为我可以 link 本机库 "libKinesisVideoProducerJNI.so" 当我将它上传到 AWS lambda 时,我不断收到错误

WARN / KinesisVideo: Unsatisfied link error. Directly loading native library .so.

22:19:11
WARN / KinesisVideo: Unsatisfied link error. Directly loading native library .dylib.

22:19:11
WARN / KinesisVideo: Unsatisfied link error. Directly loading native library .dll.

22:19:11
WARN / KinesisVideo: Unsatisfied link error. Directly loading native library libKinesisVideoProducerJNI.so.

22:19:11
WARN / KinesisVideo: Unsatisfied link error. Directly loading native library libKinesisVideoProducerJNI.dylib.

22:19:11
WARN / KinesisVideo: Unsatisfied link error. Directly loading native library libKinesisVideoProducerJNI.dll.

22:19:11
ERROR / KinesisVideo: 2018-06-02T22:19Z T1: EXCEPTION: UnsatisfiedLinkError: Unsatisfied link error. Loading native library KinesisVideoProducerJNI failed with java.lang.UnsatisfiedLinkError: no KinesisVideoProducerJNI in java.library.path: no KinesisVideoProducerJNI in java.library.path

22:19:11
com.amazonaws.kinesisvideo.producer.ProducerException: Failed loading native library

我如何 add/link aws Lambda 的原生库?

用java写的代码我用eclipse到build/upload到AWS lambda

通过将文件上传到 S3 存储桶解决了问题, 然后将文件作为 S3Object 取回并将其保存到 "/tmp/libKinesisVideoProducerJNI.so" 然后加载它

S3Object libso = awsObject.getObject(s3Client, "bucket", "libKinesisVideoProducerJNI.so");

            File lib = awsObject.save(libso.getObjectContent(), "/tmp/libKinesisVideoProducerJNI.so");

            System.out.println("library file was saved to " + lib.getAbsolutePath());

            System.load(lib.getAbsolutePath());