chocopie116 / daifuku

Other
0 stars 0 forks source link

とりあえずmacで動かす #1

Open chocopie116 opened 6 years ago

chocopie116 commented 6 years ago

Create stream image

chocopie116 commented 6 years ago

https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-java 公式ドキュメントにあるjavaのデモアプリ動かしてみた

intellijでmvnのpom.xmlをimportして、runしてみたら以下のエラーがでた。 きびしいw

/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/bin/java -Didea.launcher.port=7533 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/lib/tools.jar:/Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-java/target/classes:/Users/t-kajinuma/.m2/repository/com/amazonaws/aws-java-sdk-core/1.11.172/aws-java-sdk-core-1.11.172.jar:/Users/t-kajinuma/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar:/Users/t-kajinuma/.m2/repository/org/apache/httpcomponents/httpclient/4.5.2/httpclient-4.5.2.jar:/Users/t-kajinuma/.m2/repository/org/apache/httpcomponents/httpcore/4.4.4/httpcore-4.4.4.jar:/Users/t-kajinuma/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar:/Users/t-kajinuma/.m2/repository/software/amazon/ion/ion-java/1.0.2/ion-java-1.0.2.jar:/Users/t-kajinuma/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.6.7.1/jackson-databind-2.6.7.1.jar:/Users/t-kajinuma/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.6.0/jackson-annotations-2.6.0.jar:/Users/t-kajinuma/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.6.7/jackson-core-2.6.7.jar:/Users/t-kajinuma/.m2/repository/com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.6.7/jackson-dataformat-cbor-2.6.7.jar:/Users/t-kajinuma/.m2/repository/joda-time/joda-time/2.8.1/joda-time-2.8.1.jar:/Users/t-kajinuma/.m2/repository/com/google/inject/guice/4.0/guice-4.0.jar:/Users/t-kajinuma/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/Users/t-kajinuma/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/Users/t-kajinuma/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/Users/t-kajinuma/.m2/repository/com/google/guava/guava/21.0/guava-21.0.jar:/Users/t-kajinuma/.m2/repository/com/google/code/findbugs/annotations/2.0.3/annotations-2.0.3.jar:/Users/t-kajinuma/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar:/Users/t-kajinuma/.m2/repository/com/google/code/gson/gson/2.8.2/gson-2.8.2.jar:/Users/t-kajinuma/.m2/repository/javax/measure/jsr-275/0.9.1/jsr-275-0.9.1.jar:/Users/t-kajinuma/.m2/repository/com/google/inject/extensions/guice-multibindings/4.0/guice-multibindings-4.0.jar:/Users/t-kajinuma/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar:/Users/t-kajinuma/.m2/repository/com/amazonaws/aws-java-sdk-kinesisvideo/1.11.238/aws-java-sdk-kinesisvideo-1.11.238.jar:/Users/t-kajinuma/.m2/repository/io/netty/netty-codec-http/4.1.17.Final/netty-codec-http-4.1.17.Final.jar:/Users/t-kajinuma/.m2/repository/io/netty/netty-codec/4.1.17.Final/netty-codec-4.1.17.Final.jar:/Users/t-kajinuma/.m2/repository/io/netty/netty-handler/4.1.17.Final/netty-handler-4.1.17.Final.jar:/Users/t-kajinuma/.m2/repository/io/netty/netty-buffer/4.1.17.Final/netty-buffer-4.1.17.Final.jar:/Users/t-kajinuma/.m2/repository/io/netty/netty-common/4.1.17.Final/netty-common-4.1.17.Final.jar:/Users/t-kajinuma/.m2/repository/io/netty/netty-transport/4.1.17.Final/netty-transport-4.1.17.Final.jar:/Users/t-kajinuma/.m2/repository/io/netty/netty-resolver/4.1.17.Final/netty-resolver-4.1.17.Final.jar:/Users/t-kajinuma/.m2/repository/com/amazonaws/jmespath-java/1.11.238/jmespath-java-1.11.238.jar:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain com.amazonaws.kinesisvideo.demoapp.DemoAppMain
WARN / KinesisVideo: Unsatisfied link error. Directly loading native library .so.
WARN / KinesisVideo: Unsatisfied link error. Directly loading native library .dylib.
WARN / KinesisVideo: Unsatisfied link error. Directly loading native library .dll.
WARN / KinesisVideo: Unsatisfied link error. Directly loading native library libKinesisVideoProducerJNI.so.
WARN / KinesisVideo: Unsatisfied link error. Directly loading native library libKinesisVideoProducerJNI.dylib.
WARN / KinesisVideo: Unsatisfied link error. Directly loading native library libKinesisVideoProducerJNI.dll.
ERROR / KinesisVideo: 2017-12-11T00:22Z 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
Exception in thread "main" java.lang.RuntimeException: com.amazonaws.kinesisvideo.producer.ProducerException: Failed loading native library
    at com.amazonaws.kinesisvideo.demoapp.DemoAppMain.main(DemoAppMain.java:45)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: com.amazonaws.kinesisvideo.producer.ProducerException: Failed loading native library
    at com.amazonaws.kinesisvideo.producer.jni.NativeKinesisVideoProducerJni.initializeLibrary(NativeKinesisVideoProducerJni.java:1045)
    at com.amazonaws.kinesisvideo.producer.jni.NativeKinesisVideoProducerJni.create(NativeKinesisVideoProducerJni.java:213)
    at com.amazonaws.kinesisvideo.producer.jni.NativeKinesisVideoProducerJni.create(NativeKinesisVideoProducerJni.java:186)
    at com.amazonaws.kinesisvideo.client.NativeKinesisVideoClient.initialize(NativeKinesisVideoClient.java:112)
    at com.amazonaws.kinesisvideo.java.client.KinesisVideoJavaClientFactory.createKinesisVideoClient(KinesisVideoJavaClientFactory.java:106)
    at com.amazonaws.kinesisvideo.java.client.KinesisVideoJavaClientFactory.createKinesisVideoClient(KinesisVideoJavaClientFactory.java:79)
    at com.amazonaws.kinesisvideo.demoapp.DemoAppMain.main(DemoAppMain.java:31)
    ... 5 more
chocopie116 commented 6 years ago

クラスメソッドのブログがあるので、c++のやつ動かしてみるか https://dev.classmethod.jp/cloud/aws/mac-kinesis-video-stream-getting-started/

とりあえずbuildしておいておく

chocopie116 commented 6 years ago

buildでbisonのversion指定されたものがおちるのでbrewでinstallしたbisonにうわがきした

 export PATH=/usr/local/Cellar/bison/3.0.4_1/bin:$PATH
chocopie116 commented 6 years ago
❯ sudo ./install-script
cmake version 3.8.1 CMake suite maintained and supported by Kitware (kitware.com/cmake).
Checking openssl at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/libssl.a
Checking curl at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/libcurl.a
Checking log4cplus at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/liblog4cplus.dylib/.so
Checking gettext at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/libgettextlib.dylib/.so
Checking libffi at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/libffi.a
Checking pcre at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/libpcre.dylib/.so
Checking zlib at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/libz.dylib/.so
Checking iconv at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/libiconv.dylib/.so
Checking glib at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/libglib-2.0.dylib/.so
Checking gstreamer at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/libgstreamer-1.0.dylib/.so
Checking gst-plugin-base at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/libgstvideo-1.0.dylib/.so
Checking gst-plugin-good at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/gstreamer-1.0/libgstavi.la
Checking gst-plugin-bad at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/libgstbadvideo-1.0.dylib/.so
Checking x264 at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/libx264.dylib/.so
Checking gst-plugin-ugly at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/gstreamer-1.0/libgstx264.dylib/.so
Checking googletest at /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib/libgtest.a
-- System name is Darwin
-- Kinesis Video PIC path is ../kinesis-video-pic
-- Kinesis Video Producer path is ../kinesis-video-producer
-- Kinesis Video JNI path is ../kinesis-video-producer-jni
-- Kinesis Video Gstreamer demp app path is ../kinesis-video-gst-demo
-- Kinesis Video Open Source path is /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build
[ 91%] Built target producer
[ 91%] Building CXX object CMakeFiles/KinesisVideoProducerJNI.dir/Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-producer-jni/src/source/com/amazonaws/kinesis/video/producer/jni/KinesisVideoClientWrapper.cpp.o
In file included from /Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-producer-jni/src/source/com/amazonaws/kinesis/video/producer/jni/KinesisVideoClientWrapper.cpp:5:
/Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/../kinesis-video-producer-jni/src/include/com/amazonaws/kinesis/video/producer/jni/KinesisVideoClientWrapper.h:14:10: fatal error:
      'jni.h' file not found
#include <jni.h>                  // Basic native API
         ^~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/KinesisVideoProducerJNI.dir/Users/t-kajinuma/.go/src/github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-producer-jni/src/source/com/amazonaws/kinesis/video/producer/jni/KinesisVideoClientWrapper.cpp.o] Error 1
make[1]: *** [CMakeFiles/KinesisVideoProducerJNI.dir/all] Error 2
make: *** [all] Error 2
zsh: exit 2     sudo ./install-script