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

Cant run any of the examples on Windows using Eclipse #160

Closed 3AGSystems closed 2 years ago

3AGSystems commented 2 years ago

I have downloaded the parser library and I have opened the project with Eclipse. Imported the project as a "Existing Maven Project". When I try to run the project I have several errors "log cannot be resolved" and "The default case is already defined". When I look at the "The default case is already defined" errors I can see several "Switch" statements with more than one default case in it, which does not make any sense to me. I don't see any windows folder under the "src\main\resources" folder. Seems there is only a "libKinesisVideoProducerJNI.so" file which is for Linux machine. I'm using Eclipse IDE for Java Developers version 2022 - 03 on Windows 10 operating system. I was able to get the "Java Producer Library" example to work on the same machine and setup. In the "Java Producer Library" I set my "NativeLibraryPath" to the "\src\main\resources\lib\windows" folder where the file "KinesisVideoProducerJNI.dll" is located. But in this sample I cannot find that file. Can you please let me know how I can get this solution to work on my environment.

Quick summary of what I'm trying to do is. First I need to create a video stream and sent it to Kinesis Video which I was able to do using the Java producer library. Next I need to read the stream via GetMedia. I got the Java producer library working and I was able to stream the date to Kinesis Video. Now I'm trying to read from the Kinesis Video via GetMedia endpoint and parse the results into JPEG/PNG format. I could also use the combinations of ListFragments and GetMediaForFragementList API to get the media. I just need to be able to convert the frames into images so than I could use those images to do anomaly detection using the "Amazon Lookout For Vision". So summary of my requirement is to read from Kinesis video stream and convert the frames to images so I can pass the images to S3 bucket. Please let me know If there is a easier way to do this rather than the parser library. I put an image of the errors I get on Eclipse below

Thank you for your time,

Shervin

image image

unicornss commented 2 years ago

Hi @3AGSystems,

First I need to create a video stream and sent it to Kinesis Video which I was able to do using the Java producer library. Next I need to read the stream via GetMedia. I got the Java producer library working and I was able to stream the date to Kinesis Video. Now I'm trying to read from the Kinesis Video via GetMedia endpoint and parse the results into JPEG/PNG format.

Glad to see that you could ingest media using Java producer library successfully.

my requirement is to read from Kinesis video stream and convert the frames to images so I can pass the images to S3 bucket.

Could you please email kinesis-video-support@amazon.com with your use case along with the latency requirements? KVS team will provide suggestions/guidance on how to generate images from media ingested into KVS.

Thanks.

3AGSystems commented 2 years ago

Thank you for your response @unicornss

I have emailed my requirements to the Kinesis Video Support email you mentioned and asked for suggestions.

Also I was wondering if you noticed the same errors I see when you download the parser library example and open it using Eclipse for Java Developers? It still makes no sense to me why there is switch statements with multiple default cases in it. I can run some of the J-Unit tests but I cannot run it in debug mode or run other parts of projects dues to these errors. Let me know if I need to run something to get the project to work without any errors on Eclipse.

I have tried to add the piece of code provided on the documentation to be able to save each frame as a PNG file but the code does not get to that section. I searched for "AWTUtil.toBufferedImage(rgb, renderImage)" on the entire project and I have located that syntax on "FrameRendererVisitor" class under "src/main/java/com/amazonaws/kinesisvideo/parser/unilities/" folder. I tried to add the suggested code there but I cannot run the J-Unit test as DebugAs or RunAs. Once again procedure I followed was download the project. Import into Eclipse for Java Deveopers IDE as Maven Existing Project, than did a Maven Clean and Install on Eclipse.

My environment specs are:

Windows 10 Java 18 Apache Maven 3.8.5

Below is the image of the instructions on the documentation which I followed.

image

unicornss commented 2 years ago

Also I was wondering if you noticed the same errors I see when you download the parser library example

No, there are no errors in importing a new project in Intellij IDE. It has been a while using Eclipse or MyEclipse but there should not be any issue if the build path is setup correctly. The code for the EBML parser in the IDE should be same as in here. Please consult your IDE documentation for setting up the build path for Windows environment or try other IDEs like IntelliJ, VSCode for testing.

ParserLibrary-Intellij-2022-04-20 at 10 34 21 AM
unicornss commented 2 years ago

I was able to test one of the Example KinesisVideoRendererExampleTest (which 1) Ingests video 2) Consumes using GetMedia 3) Renders decoded video frames) by running the following Maven command line: ~/Utils/apache-maven-3.8.3/bin/mvn clean -Dtest=KinesisVideoRendererExampleTest test

Steps for running the tests from command line using mvn test:

  1. Check out this Github Project locally using git clone https://github.com/aws/amazon-kinesis-video-streams-parser-library.git
  2. Setup your AWS credentials
  3. Comment the @Ignore in the test example
  4. Add the MavenSurefire plugin in the pom.xml after this line
        <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-surefire-plugin</artifactId>
           <version>2.19.1</version>
             <configuration>
                <includes>
                    <include>**/*Test</include>
                   </includes>
             </configuration>
           </plugin>
  5. Run the mvn command line mvn clean -Dtest=KinesisVideoRendererExampleTest test

You should see the re:Invent vogels_480.mkv video playing locally now.

3AGSystems commented 2 years ago

Thank you for your response.

I will take a look at your suggestions. But one thing I can mention is I have tried to run the project without IDE. I download the project and run " mvn clean install " as suggested but I get a bunch of "duplicate default label" errors. It's not just the "EBML" parser class which has the case statement with multiple defaults. If you take a look I can see it in "MkvDataElement.java", "Frame.java", "MkvDataElement.java", "FragmentMetadataVisitor.java" and "OutputSegmentMerger.java". Steps to reproduce these errors on terminal are. Download the parser library, change the terminal directory to the downloaded library and run " mvn clean install ". I have attached screenshot of the terminal output to this email. Please let me know what step I'm doing wrong.

Once again thanks for your help and time.

Sherivn Mirsaeidi

On Wed, 20 Apr 2022 at 10:32, Siva Somasundaram @.***> wrote:

Also I was wondering if you noticed the same errors I see when you download the parser library example

No, there are no errors in importing a new project in Intellij https://download.jetbrains.com/idea/ideaIC-2022.1.exe IDE. It has been a while using Eclipse or MyEclipse but there should not be any issue if the build path is setup correctly. The code http://amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/EBMLParser.java for the EBML parser in the IDE should be same as in here https://github.com/aws/amazon-kinesis-video-streams-parser-library/blob/master/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/EBMLParser.java#L91. Please consult your IDE documentation for setting up the build path for Windows environment or try other IDEs like IntelliJ, VSCode https://code.visualstudio.com/ for testing.

— Reply to this email directly, view it on GitHub https://github.com/aws/amazon-kinesis-video-streams-parser-library/issues/160#issuecomment-1104221852, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKUNNWC3Y4G5MLRCPP645O3VGA5TJANCNFSM5TXNYGEA . You are receiving this because you modified the open/close state.Message ID: <aws/amazon-kinesis-video-streams-parser-library/issues/160/1104221852 @github.com>

unicornss commented 2 years ago

OS: MacOS 10.15.7 Output from sample test run:

~/Utils/apache-maven-3.8.3/bin/mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] -----< com.amazonaws:amazon-kinesis-video-streams-parser-library >------
[INFO] Building Amazon Kinesis Video Streams Parser Library 1.2.4
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ amazon-kinesis-video-streams-parser-library ---
[INFO] Deleting /private/tmp/amazon-kinesis-video-streams-parser-library/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.501 s
[INFO] Finished at: 2022-04-20T11:16:47-07:00
[INFO] ------------------------------------------------------------------------
~/Utils/apache-maven-3.8.3/bin/mvn clean  -Dtest=KinesisVideoRendererExampleTest test
[INFO] Scanning for projects...
[INFO]
[INFO] -----< com.amazonaws:amazon-kinesis-video-streams-parser-library >------
[INFO] Building Amazon Kinesis Video Streams Parser Library 1.2.4
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ amazon-kinesis-video-streams-parser-library ---
[INFO]
[INFO] --- lombok-maven-plugin:1.18.20.0:delombok (delombok) @ amazon-kinesis-video-streams-parser-library ---
Copying resource file: com/amazonaws/kinesisvideo/parser/examples/.DS_Store
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/kinesis/KinesisDataStreamsWorker.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/kinesis/KinesisRecordProcessor.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/MkvElementVisitException.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/MkvElementVisitor.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/visitors/CountVisitor.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/visitors/ElementSizeAndOffsetVisitor.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/visitors/CompositeMkvElementVisitor.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/visitors/CopyVisitor.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/Frame.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/StreamingMkvReader.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/MkvTypeInfoProvider.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/FrameProcessException.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/MkvDataElement.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/MkvStartMasterElement.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/MkvElement.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/MkvStreamReaderCallback.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/MkvEndMasterElement.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/mkv/MkvValue.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264FrameEncoder.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/MkvTrackMetadata.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/SimpleFrameVisitor.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/FragmentMetadataVisitor.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264BoundingBoxFrameRenderer.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/FrameRendererVisitor.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264FrameDecoder.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/DynamoDBHelper.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/FragmentMetadata.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/H264FrameRenderer.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/consumer/MergedOutputPiper.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/consumer/FragmentMetadataCallback.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/consumer/FragmentProgressTracker.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/consumer/GetMediaResponseStreamConsumer.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/consumer/GetMediaResponseStreamConsumerFactory.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/consumer/MergedOutputPiperFactory.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/OutputSegmentMerger.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/BufferedImageUtil.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/MkvChildElementCollector.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/MkvTag.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/FrameVisitor.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/ProducerStreamUtil.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/StreamOps.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/KinesisVideoBoundingBoxFrameViewer.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/GetMediaWorker.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/KinesisVideoFrameViewer.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/ImagePanel.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/PutMediaWorker.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/KinesisVideoCommon.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/KinesisVideoRendererExample.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/ContinuousGetMediaWorker.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/KinesisVideoRekognitionIntegrationExample.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/lambda/H264FrameProcessor.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/lambda/KinesisVideoRekognitionLambdaExample.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/lambda/KVSMediaSource.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/lambda/FragmentCheckpointManager.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/lambda/DDBBasedFragmentCheckpointManager.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/lambda/FragmentCheckpoint.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/lambda/EncodedFrame.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/BoundingBoxImagePanel.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/ListFragmentWorker.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/KinesisVideoGStreamerPiperExample.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/GetMediaForFragmentListWorker.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/examples/KinesisVideoExample.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/processor/RekognitionStreamProcessor.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/KinesisVideo.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/BoundingBox.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/StreamProcessorInformation.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/RekognitionInput.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/InputInformation.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/RekognizedOutput.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/Face.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/RekognitionOutput.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/Landmark.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/Pose.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/Quality.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/MatchedFace.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/DetectedFace.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/RekognizedFragmentsIndex.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/FaceType.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/rekognition/pojo/FaceSearchResponse.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/ParserByteSource.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/EBMLTypeInfo.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/EBMLParserInternalElement.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/EBMLUtils.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/EBMLParser.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/ReplayIdAndSizeBuffer.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/EBMLTypeInfoProvider.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/InputStreamParserByteSource.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/TrackingReplayableIdAndSizeByteSource.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/ParserBulkByteSource.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/EBMLElementMetaData.java [delomboked]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/EBMLParserCallbacks.java [unchanged]
File: /private/tmp/amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/ebml/MkvTypeInfos.java [unchanged]
[INFO] Delombok complete.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ amazon-kinesis-video-streams-parser-library ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.9.0:compile (default-compile) @ amazon-kinesis-video-streams-parser-library ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 92 source files to /private/tmp/amazon-kinesis-video-streams-parser-library/target/classes
[INFO] /private/tmp/amazon-kinesis-video-streams-parser-library/target/generated-sources/delombok/com/amazonaws/kinesisvideo/parser/kinesis/KinesisDataStreamsWorker.java: Some input files use or override a deprecated API.
[INFO] /private/tmp/amazon-kinesis-video-streams-parser-library/target/generated-sources/delombok/com/amazonaws/kinesisvideo/parser/kinesis/KinesisDataStreamsWorker.java: Recompile with -Xlint:deprecation for details.
[INFO] /private/tmp/amazon-kinesis-video-streams-parser-library/target/generated-sources/delombok/com/amazonaws/kinesisvideo/parser/utilities/FrameVisitor.java: Some input files use unchecked or unsafe operations.
[INFO] /private/tmp/amazon-kinesis-video-streams-parser-library/target/generated-sources/delombok/com/amazonaws/kinesisvideo/parser/utilities/FrameVisitor.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- lombok-maven-plugin:1.18.20.0:testDelombok (test-delombok) @ amazon-kinesis-video-streams-parser-library ---
[WARNING] Skipping Test Delombok; no source to process.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ amazon-kinesis-video-streams-parser-library ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 16 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.9.0:testCompile (default-testCompile) @ amazon-kinesis-video-streams-parser-library ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 23 source files to /private/tmp/amazon-kinesis-video-streams-parser-library/target/test-classes
[INFO] /private/tmp/amazon-kinesis-video-streams-parser-library/src/test/java/com/amazonaws/kinesisvideo/parser/utilities/OutputSegmentMergerTest.java: /private/tmp/amazon-kinesis-video-streams-parser-library/src/test/java/com/amazonaws/kinesisvideo/parser/utilities/OutputSegmentMergerTest.java uses or overrides a deprecated API.
[INFO] /private/tmp/amazon-kinesis-video-streams-parser-library/src/test/java/com/amazonaws/kinesisvideo/parser/utilities/OutputSegmentMergerTest.java: Recompile with -Xlint:deprecation for details.
[INFO] /private/tmp/amazon-kinesis-video-streams-parser-library/src/test/java/com/amazonaws/kinesisvideo/parser/ebml/TestEBMLTypeInfoProvider.java: Some input files use unchecked or unsafe operations.
[INFO] /private/tmp/amazon-kinesis-video-streams-parser-library/src/test/java/com/amazonaws/kinesisvideo/parser/ebml/TestEBMLTypeInfoProvider.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ amazon-kinesis-video-streams-parser-library ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.amazonaws.kinesisvideo.parser.examples.KinesisVideoRendererExampleTest
SLF4J: Class path contains multiple SLF4J bindings.
3AGSystems commented 2 years ago

5. mvn clean -Dtest=KinesisVideoRendererExampleTest test

@unicornss

Once again I appreciate your quick reply. I have tried you suggestion steps.

1) I used Git to pull the project 2) I commented out the @Ignore on the testExample() test case in KinesisVideoRendererExampleTest 3) added the MavenSurefire plugin on the pom.xml file on the suggested line

I still get "duplicate default label" errors on build and compile.

I see some warnings platform encoding. Not sure if thats the issue. Below is the screen shots of all the console output after running the mvn command you mentioned

image image image image

3AGSystems commented 2 years ago

Intellij

I have also tried your other suggestion. I have installed IntelliJ on my windows Machine and I modified the project structure. So the SDK is selected correctly. Than I removed the @Ignore on the testExample() testcase in KinesisVideoRendererExampleTest. Than I right clicked the KinesisVideoRendererExampleTest class and selected Run 'KinesisVideoRendererExampleTest ' . The build output has the same errors as before. The target classed contain switch statements with multiple default cases.

Please let me know if I missed any steps

Screen shots are below

image image

unicornss commented 2 years ago

Seems you are referring to the de-Lombok sources (in target / generated-sources) - generated based on annotations which differs from the source folder. You can find steps to set up your environment for Lombok here. This post suggests maven clean plugin can help, but I don’t have a Windows machine to confirm..

Is Windows environment a requirement for your use case?

Could you share more details on the setup and what media source you are planning to upload to KVS? also, could you reply to the email response thread from kinesis-video-support@amazon.com?

Thanks

3AGSystems commented 2 years ago

Seems you are referring to the de-Lombok sources (in target / generated-sources) - generated based on annotations which differs from the source folder. You can find steps to set up your environment for Lombok here. This post suggests maven clean plugin can help, but I don’t have a Windows machine to confirm..

Is Windows environment a requirement for your use case?

Could you share more details on the setup and what media source you are planning to upload to KVS? also, could you reply to the email response thread from kinesis-video-support@amazon.com?

Thanks

@unicornss Thanks again for your reply and new suggestions,

I have downloaded and enabled the "Lombok Plugin". Than I looked at the link you send and followed the instructions on providing a non-default . I also enabled the annotation processing under the Compiler preference on Intellij. After re building the project I get a few cannot find symbol class errors. I will post all the errors on the bottom so you can take a look.

Yes windows is what I use for my development environment.

What I'm using is the Java Producer library which is from the following sample on AWS (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/producersdk-javaapi-downloadcode.html)

Using this library I was able to stream a video into Kinesis Video Streams and was able to successfully view the repeating video on the Media playback on the AWS management console. Now I need to be able to programmatically read from the stream via GetMedia. Than convert the fragments and frames into images. I don't need to get images for all frames. Maybe every few seconds save a sample photo. Than I will upload this sample photo to S3 bucket where I can use Amazon Lookout for Vision to do anomaly detection on the photos. I could also use the same photos to run anomaly detection using my own trained model which I can import into SageMaker. My requirement is to read stream from KVS and convert it to photos.

I have also send a email to the Kinesis Video Support email you send me and I got reply from PM that there is a new feature that will be lunched soon that can help my use case. Also he suggested I meet with him to dive deep into what my options are. But until then I need to to do proof of concept for all my options such as Amazon Lookout for Vision or Amazon Rekognitoin or Processing the photo with my own model.

Below are the errors I got after your suggestions:

image

3AGSystems commented 2 years ago

Seems you are referring to the de-Lombok sources (in target / generated-sources) - generated based on annotations which differs from the source folder. You can find steps to set up your environment for Lombok here. This post suggests maven clean plugin can help, but I don’t have a Windows machine to confirm.. Is Windows environment a requirement for your use case? Could you share more details on the setup and what media source you are planning to upload to KVS? also, could you reply to the email response thread from kinesis-video-support@amazon.com? Thanks

@unicornss Thanks again for your reply and new suggestions,

I have downloaded and enabled the "Lombok Plugin". Than I looked at the link you send and followed the instructions on providing a non-default . I also enabled the annotation processing under the Compiler preference on Intellij. After re building the project I get a few cannot find symbol class errors. I will post all the errors on the bottom so you can take a look.

Yes windows is what I use for my development environment.

What I'm using is the Java Producer library which is from the following sample on AWS (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/producersdk-javaapi-downloadcode.html)

Using this library I was able to stream a video into Kinesis Video Streams and was able to successfully view the repeating video on the Media playback on the AWS management console. Now I need to be able to programmatically read from the stream via GetMedia. Than convert the fragments and frames into images. I don't need to get images for all frames. Maybe every few seconds save a sample photo. Than I will upload this sample photo to S3 bucket where I can use Amazon Lookout for Vision to do anomaly detection on the photos. I could also use the same photos to run anomaly detection using my own trained model which I can import into SageMaker. My requirement is to read stream from KVS and convert it to photos.

I have also send a email to the Kinesis Video Support email you send me and I got reply from PM that there is a new feature that will be lunched soon that can help my use case. Also he suggested I meet with him to dive deep into what my options are. But until then I need to to do proof of concept for all my options such as Amazon Lookout for Vision or Amazon Rekognitoin or Processing the photo with my own model.

Below are the errors I got after your suggestions:

image

@unicornss

Were you able to see why I'm getting those errors on Windows on my latest reply above after doing the steps you recommended?

3AGSystems commented 2 years ago
org.apache.maven.plugins maven-surefire-plugin 2.19.1 **/*Test

Following the steps suggested above I was able to get this sample working using IntelliJ IDEA on Windows environment

1) Check out this Github Project locally using git clone https://github.com/aws/amazon-kinesis-video-streams-parser-library.git 2) Setup your AWS credentials 3) Comment the @Ignore in the testExample() test case under KinesisVideoRendererExampleTest 4) Add the MavenSurefire plugin in the pom.xml after the line mentioned above in @unicornss suggestion

   <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      <version>2.19.1</version>
        <configuration>
           <includes>
               <include>**/*Test</include>
              </includes>
        </configuration>
      </plugin>

5) Open maven project in IntelliJ IDEA
6) Under the Maven tool bar. Under the Lifecycle fodler. Double click clean and than double click package 7) Right click project and under Maven run Reload project 8) Click file than clikc Project Structure. Under Project Settings click Module. Under sources navigate to src/main/java. Than click Mark as Sources. On the same windows under Sources Folder click Unmark Source next to target...\delombok [generated]. Than click Apply and than Click OK

9) You can run the testExample() under KinesisVideoRendererExampleTest

Once again thank you for all your help @unicornss