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

Video parser issue duirng fragment

Closed this issue · 1 comments

I have installed kinesis producer sdk and run live camera stream with kinesis using gstream command, also pass the fragment to sagemaker for analytics using your library, but when i run some of camera stream its stucked over ContinuousGetMediaWorker worked going sleeping mode.... in every thread.

when below worked run its saying exceltpin via this catch (Throwable t)

I have no idea why this happening

while (!shouldStop.get()) {
GetMediaResult getMediaResult = null;
try {

            StartSelector selectorToUse = fragmentNumberToStartAfter.map(fn -> new StartSelector().withStartSelectorType(StartSelectorType.FRAGMENT_NUMBER)
                    .withAfterFragmentNumber(fn)).orElse(startSelector);

            getMediaResult = videoMedia.getMedia(new GetMediaRequest().withStreamName(streamName).withStartSelector(selectorToUse));
            log.info("Start processing GetMedia called for stream {} response {} requestId {}",
                    streamName,
                    getMediaResult.getSdkHttpMetadata().getHttpStatusCode(),
                    getMediaResult.getSdkResponseMetadata().getRequestId());

            if (getMediaResult.getSdkHttpMetadata().getHttpStatusCode() == HTTP_STATUS_OK) {
                try (GetMediaResponseStreamConsumer consumer = consumerFactory.createConsumer()) {
                    consumer.process(getMediaResult.getPayload(), this::updateFragmentNumberToStartAfter);
                }
            } else {
                Thread.sleep(200);
            }
        } catch (FrameProcessException e) {
            log.error("FrameProcessException in ContinuousGetMedia worker for stream: " + streamName, e);
            break;
        } catch (IOException | MkvElementVisitException e) {
            log.error("Failure in ContinuousGetMedia worker for stream: " + streamName, e);
        } catch (InterruptedException ie) {
            Thread.currentThread().interrupt();
            throw new RuntimeException(ie);
        } catch (Throwable t) {
            log.error("Throwable",t);
        } finally {
            closeGetMediaResponse(getMediaResult);
            log.info("Exit processing GetMedia called for stream {}", streamName);
        }

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/Hike/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.8.2/log4j-slf4j-impl-2.8.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/Hike/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
This is the logs of error

ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
log4j:WARN No such property [immediateFlush] in com.amazonaws.services.lambda.runtime.log4j.LambdaAppender.
log4j:ERROR Could not find value for key log4j.appender.CONSOLE
log4j:ERROR Could not instantiate appender named "CONSOLE".
ERROR GetMediaWorker Failure in GetMediaWorker for streamName superfast java.lang.AssertionError