aws / amazon-kinesis-video-streams-parser-library

Amazon Kinesis Video Streams parser library is for developers to include in their applications that makes it easy to work with the output of video streams such as retrieving frame-level objects, metadata for fragments, and more.
Apache License 2.0
103 stars 52 forks source link

How to use this Parser Library in Android Project? #138

Closed cjfei closed 11 months ago

cjfei commented 2 years ago

Help needed. I have added some metadata from producer side using kvs producer cpp. Now I want to retrieve the mkv metadata using Stream Parser Library and display it on my android App. I import the Parser Libary into my android project by "implementation 'com.amazonaws:amazon-kinesis-video-streams-parser-library:1.0.15' ", but the android project cannot be built. I dont know how to start in android project. Can anyone tell how to retrieve metadata in android project?

IDE: Android Studio (v4.1) Language: Java. OS: Window 10.

Tseema commented 2 years ago

were able get this sorted? if yes could you pls explain the solution?

sirknightj commented 11 months ago

Hi @cjfei, it would be great if you could share the error messages you are seeing so we can help out further.

I was able to import the parser library into this android project by adding this to build.gradle:

implementation('com.amazonaws:amazon-kinesis-video-streams-parser-library:1.2.5') {
    transitive = false
}
image

Note that in the other project, we have the android versions of the aws-sdk-java already imported from the other dependencies, which is why we needed to use transitive = false to exclude those modules to avoid duplicates:

Duplicate class com.amazonaws.AbortedException found in modules aws-android-sdk-core-2.73.0-runtime (com.amazonaws:aws-android-sdk-core:2.73.0) and aws-java-sdk-core-1.12.406 (com.amazonaws:aws-java-sdk-core:1.12.406)
Duplicate class com.amazonaws.AmazonClientException found in modules aws-android-sdk-core-2.73.0-runtime (com.amazonaws:aws-android-sdk-core:2.73.0) and aws-java-sdk-core-1.12.406 (com.amazonaws:aws-java-sdk-core:1.12.406)
Duplicate class com.amazonaws.AmazonServiceException found in modules aws-android-sdk-core-2.73.0-runtime (com.amazonaws:aws-android-sdk-core:2.73.0) and aws-java-sdk-core-1.12.406 (com.amazonaws:aws-java-sdk-core:1.12.406)
Duplicate class com.amazonaws.AmazonServiceException$ErrorType found in modules aws-android-sdk-core-2.73.0-runtime (com.amazonaws:aws-android-sdk-core:2.73.0) and aws-java-sdk-core-1.12.406 (com.amazonaws:aws-java-sdk-core:1.12.406)
...

Refer to the gradle documentation as well if you want to include certain transitive dependencies, but exclude some.