awslabs / amazon-kinesis-video-streams-producer-sdk-java

Allows developers to install and customize their connected camera and other devices to securely stream video, audio, and time-encoded data to Kinesis Video Streams
Apache License 2.0
78 stars 75 forks source link

DemoAppMain doesn't run on Mac M1 pro. #169

Closed prats37 closed 1 year ago

prats37 commented 2 years ago

I tried running the DemoAppMain following the instrutions given in Readme.md but got error while running the application. Seems that the library which you have provided work only with Intel chip mac and not with M1 chip. I tried building it's Cpp application as well to generate library but in that also I am getting errors.

java -classpath target/amazon-kinesis-video-streams-producer-sdk-java-1.12.1-jar-with-dependencies.jar -Daws.accessKeyId=XXXX -Daws.secretKey=XXXX -Dkvs-stream=XXXX -Djava.library.path=/Users/pratyush/eclipse-workspace/amazon-kinesis-video-streams-producer-sdk-java/src/main/resources/lib/mac -Dlog4j.configurationFile=log4j2.xml com.amazonaws.kinesisvideo.demoapp.DemoAppMain 2022-06-16 14:55:22,203 [main] ERROR c.a.k.j.c.KinesisVideoJavaClientFactory - Unsatisfied link error. java.lang.UnsatisfiedLinkError: /Users/pratyush/eclipse-workspace/amazon-kinesis-video-streams-producer-sdk-java/src/main/resources/lib/mac/libKinesisVideoProducerJNI.dylib: dlopen(/Users/pratyush/eclipse-workspace/amazon-kinesis-video-streams-producer-sdk-java/src/main/resources/lib/mac/libKinesisVideoProducerJNI.dylib, 0x0001): tried: '/Users/pratyush/eclipse-workspace/amazon-kinesis-video-streams-producer-sdk-java/src/main/resources/lib/mac/libKinesisVideoProducerJNI.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) at java.base/jdk.internal.loader.NativeLibraries.load(Native Method) at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:384) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:228) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:170) at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:311) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:283) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2422) at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818) at java.base/java.lang.System.loadLibrary(System.java:1989) at com.amazonaws.kinesisvideo.internal.producer.jni.NativeLibraryLoader.loadNativeLibraryIndirect(NativeLibraryLoader.java:76) at com.amazonaws.kinesisvideo.internal.producer.jni.NativeLibraryLoader.loadNativeLibrary(NativeLibraryLoader.java:44) at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.initializeLibrary(NativeKinesisVideoProducerJni.java:1175) at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.create(NativeKinesisVideoProducerJni.java:228) at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.createSync(NativeKinesisVideoProducerJni.java:246) at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.createSync(NativeKinesisVideoProducerJni.java:211) at com.amazonaws.kinesisvideo.internal.client.NativeKinesisVideoClient.initializeNewKinesisVideoProducer(NativeKinesisVideoClient.java:239) at com.amazonaws.kinesisvideo.internal.client.NativeKinesisVideoClient.initialize(NativeKinesisVideoClient.java:119) at com.amazonaws.kinesisvideo.java.client.KinesisVideoJavaClientFactory.createKinesisVideoClient(KinesisVideoJavaClientFactory.java:111) at com.amazonaws.kinesisvideo.java.client.KinesisVideoJavaClientFactory.createKinesisVideoClient(KinesisVideoJavaClientFactory.java:84) at com.amazonaws.kinesisvideo.demoapp.DemoAppMain.main(DemoAppMain.java:49) 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:66) Caused by: com.amazonaws.kinesisvideo.producer.ProducerException: Failed loading native library StatusCode: 0xd at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.initializeLibrary(NativeKinesisVideoProducerJni.java:1176) at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.create(NativeKinesisVideoProducerJni.java:228) at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.createSync(NativeKinesisVideoProducerJni.java:246) at com.amazonaws.kinesisvideo.internal.producer.jni.NativeKinesisVideoProducerJni.createSync(NativeKinesisVideoProducerJni.java:211) at com.amazonaws.kinesisvideo.internal.client.NativeKinesisVideoClient.initializeNewKinesisVideoProducer(NativeKinesisVideoClient.java:239) at com.amazonaws.kinesisvideo.internal.client.NativeKinesisVideoClient.initialize(NativeKinesisVideoClient.java:119) at com.amazonaws.kinesisvideo.java.client.KinesisVideoJavaClientFactory.createKinesisVideoClient(KinesisVideoJavaClientFactory.java:111) at com.amazonaws.kinesisvideo.java.client.KinesisVideoJavaClientFactory.createKinesisVideoClient(KinesisVideoJavaClientFactory.java:84) at com.amazonaws.kinesisvideo.demoapp.DemoAppMain.main(DemoAppMain.java:49)

disa6302 commented 2 years ago

@prats37 ,

Yes. We have not generated M1 chip libraries for JNI yet. When generating on your own, what are the errors you are encountering on CPP SDK?

niyatim23 commented 1 year ago

Producer CPP SDK's develop can now be built on M1.