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

getting errors when running the KinesisVideoRekonitionLambdaExample.java #168

Closed PoojaR161 closed 11 months ago

PoojaR161 commented 1 year ago

hello!

I'm trying to run this lambda example code from https://github.com/aws/amazon-kinesis-video-streams-parser-library#kinesisvideorekognitionlambdaexample.

I was following the mentioned steps below to run the code:

    • Run mvn package from 'amazon-kinesis-video-streams-parser-library' folder. Upload './target/amazon-kinesis-video-streams-parser-library-$VERSION-shaded.jar' file to a S3 bucket.
    • Note the S3 bucket and key name.
    • Find the file LambdaExampleCFnTemplate.yml in the github package.
    • Goto AWS CloudFormation console and create stack using above template, follow the description to the input parameters.
    • Now start the producer to ingest data into Kinesis Video Streams for which the Rekognition stream processor is configured.
    • Lambda will be triggered as soon as the Rekognition stream processor starts emitting records in Kinesis Data Streams. Lambda will also create a new Kinesis Video streams with the input stream name + 'Rekognized' suffix and ingest frames overlapped with bounding boxes which should be viewable in Kinesis Video Streams console.
    • To troubleshoot any issues, use Monitoring tab in lambda and click 'View logs in Cloudwatch'.
  1. NOTE: As this lambda executes resource intense decoding and encoding (using Jcodec which is not optimal https://github.com/jcodec/jcodec#performance--quality-considerations), the new Kinesis Video stream might be delayed significantly.

The 5th step says to start the producer, but I don't understand if I have to run the lambda code also after starting the producer. However, I checked by running the lambda code when producer is running but, it shows the below error.

docker ps "C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd" build Function --template D:\KVS\java-stream-parser-master.aws-sam\temp-template.yaml --build-dir D:\KVS\java-stream-parser-master.aws-sam\build --use-container Starting Build inside a container Building codeuri: D:\KVS\java-stream-parser-master runtime: java8.al2 metadata: {} architecture: x86_64 functions: Function

Fetching public.ecr.aws/sam/build-java8.al2:latest-x86_64 Docker container image...... Mounting D:\KVS\java-stream-parser-master as /tmp/samcli/source:ro,delegated inside runtime container

Build Failed Running JavaMavenWorkflow:MavenBuild Error: JavaMavenWorkflow:MavenBuild - Maven Failed: [INFO] Scanning for projects... Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/1.4.0.RELEASE/spring-boot-starter-parent-1.4.0.RELEASE.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/1.4.0.RELEASE/spring-boot-starter-parent-1.4.0.RELEASE.pom (7.4 kB at 4.6 kB/s)... [INFO] [INFO] -----< com.amazonaws:amazon-kinesis-video-streams-parser-library >------ [INFO] Building Amazon Kinesis Video Streams Parser Library 1.0.15 [INFO] --------------------------------[ jar ]--------------------------------- Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-javadoc-plugin/3.1.1/maven-javadoc-plugin-3.1.1.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-javadoc-plugin/3.1.1/maven-javadoc-plugin-3.1.1.pom (18 kB at 12 kB/s)... [INFO] [INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ amazon-kinesis-video-streams-parser-library --- Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.2.1/maven-plugin-api-2.2.1.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.2.1/maven-plugin-api-2.2.1.pom (1.5 kB at 3.4 kB/s)... [INFO] Delombok complete. [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ amazon-kinesis-video-streams-parser-library --- Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.pom (1.5 kB at 1.1 kB/s)... [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 0 resource [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ amazon-kinesis-video-streams-parser-library --- Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.pom (1.5 kB at 1.3 kB/s)... [INFO] Changes detected - recompiling the module! [INFO] Compiling 93 source files to /tmp/samcli/scratch/target/classes [INFO] /tmp/samcli/scratch/target/generated-sources/delombok/com/amazonaws/kinesisvideo/parser/kinesis/KinesisDataStreamsWorker.java: Some input files use or override a deprecated API. [INFO] /tmp/samcli/scratch/target/generated-sources/delombok/com/amazonaws/kinesisvideo/parser/kinesis/KinesisDataStreamsWorker.java: Recompile with -Xlint:deprecation for details. [INFO] /tmp/samcli/scratch/target/generated-sources/delombok/com/amazonaws/kinesisvideo/parser/mkv/MkvDataElement.java: Some input files use unchecked or unsafe operations. [INFO] /tmp/samcli/scratch/target/generated-sources/delombok/com/amazonaws/kinesisvideo/parser/mkv/MkvDataElement.java: Recompile with -Xlint:unchecked for details. [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /tmp/samcli/scratch/target/generated-sources/delombok/com/amazonaws/kinesisvideo/parser/examples/BoundingBoxImagePanel.java:[108,9] method processRekognitionOutput in class com.amazonaws.kinesisvideo.parser.examples.BoundingBoxImagePanel cannot be applied to given types; required: java.awt.Graphics,java.awt.Graphics2D,int,int,com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedOutput found: java.awt.Graphics2D,int,int,com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedOutput reason: actual and formal argument lists differ in length [ERROR] /tmp/samcli/scratch/target/generated-sources/delombok/com/amazonaws/kinesisvideo/parser/examples/lambda/H264FrameProcessor.java:[196,34] method processRekognitionOutput in class com.amazonaws.kinesisvideo.parser.examples.BoundingBoxImagePanel cannot be applied to given types; required: java.awt.Graphics,java.awt.Graphics2D,int,int,com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedOutput found: java.awt.Graphics2D,int,int,com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedOutput reason: actual and formal argument lists differ in length [ERROR] /tmp/samcli/scratch/target/generated-sources/delombok/com/amazonaws/kinesisvideo/parser/examples/lambda/H264FrameProcessor.java:[200,34] method processRekognitionOutput in class com.amazonaws.kinesisvideo.parser.examples.BoundingBoxImagePanel cannot be applied to given types; required: java.awt.Graphics,java.awt.Graphics2D,int,int,com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedOutput found: java.awt.Graphics2D,int,int,com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedOutput reason: actual and formal argument lists differ in length [INFO] 3 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 13:50 min [INFO] Finished at: 2022-12-02T06:29:29Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project amazon-kinesis-video-streams-parser-library: Compilation failure: Compilation failure: [ERROR] /tmp/samcli/scratch/target/generated-sources/delombok/com/amazonaws/kinesisvideo/parser/examples/BoundingBoxImagePanel.java:[108,9] method processRekognitionOutput in class com.amazonaws.kinesisvideo.parser.examples.BoundingBoxImagePanel cannot be applied to given types; [ERROR] required: java.awt.Graphics,java.awt.Graphics2D,int,int,com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedOutput [ERROR] found: java.awt.Graphics2D,int,int,com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedOutput [ERROR] reason: actual and formal argument lists differ in length [ERROR] /tmp/samcli/scratch/target/generated-sources/delombok/com/amazonaws/kinesisvideo/parser/examples/lambda/H264FrameProcessor.java:[196,34] method processRekognitionOutput in class com.amazonaws.kinesisvideo.parser.examples.BoundingBoxImagePanel cannot be applied to given types; [ERROR] required: java.awt.Graphics,java.awt.Graphics2D,int,int,com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedOutput [ERROR] found: java.awt.Graphics2D,int,int,com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedOutput [ERROR] reason: actual and formal argument lists differ in length [ERROR] /tmp/samcli/scratch/target/generated-sources/delombok/com/amazonaws/kinesisvideo/parser/examples/lambda/H264FrameProcessor.java:[200,34] method processRekognitionOutput in class com.amazonaws.kinesisvideo.parser.examples.BoundingBoxImagePanel cannot be applied to given types; [ERROR] required: java.awt.Graphics,java.awt.Graphics2D,int,int,com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedOutput [ERROR] found: java.awt.Graphics2D,int,int,com.amazonaws.kinesisvideo.parser.rekognition.pojo.RekognizedOutput [ERROR] reason: actual and formal argument lists differ in length [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException SAM Build has failed: Command did not exit successfully, exit code: 1 84 has failed: Command did not exit successfully, exit code: 1

Please help me to figure out what I am missing.

PoojaR161 commented 11 months ago

closing because of no replies, and somehow I figured out how to work with it!