Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream processor not reaching RUNNING state #1

Open
jorgejgnz opened this issue Jun 13, 2022 · 7 comments
Open

Stream processor not reaching RUNNING state #1

jorgejgnz opened this issue Jun 13, 2022 · 7 comments

Comments

@jorgejgnz
Copy link

jorgejgnz commented Jun 13, 2022

I'm trying to detect labels in a streaming video but the stream processor goes from STARTING state to STOPPED state. It seems not to reach RUNNING state at any moment.

If MaxDurationInSeconds is set, it finishes before reaching that duration. If it's not set, it finishes after a couple of seconds.

Sometimes it detects a label that appeared in the stream a long time ago. Sometimes, if the processor is restarted after having stopped, it detects events that have already been detected before, returning exactly the same image.

I have tried with an external webcam, built-in webcam and sample videos, but I get the same behavior in all cases.

I have checked that the producer timestamp is correct. Just after starting the processor, I capture a video of a few seconds of the stream using get_data_endpoint and get_media functions for the same timestamp used in stream processor start request. The video extracted from the stream for that timestamp shows the expected content.

Responses from stream processors's creation and start requests don't show any error.

Stream processor creation request:

response = rekognition_client.create_stream_processor(
    Input={
        'KinesisVideoStream': {
            'Arn': ...
        }
    },
    Output={
        'S3Destination': {
            'Bucket': ...
        }
    },
    Name= ...,
    Settings = {'ConnectedHome': {
        'Labels': ["PERSON", "PET", "PACKAGE","ALL"],
        'MinConfidence': 90.0
    }
    },
    RoleArn=...,
    NotificationChannel={
        'SNSTopicArn': ...
    }
)

Stream processor start request:

response = rekognition.start_stream_processor(
        Name=...,
        StartSelector={
            'KVSStreamStartSelector': {
                'ProducerTimestamp': int(time.time())
            }
        }
        #,StopSelector={'MaxDurationInSeconds': 120}
    )
@mikames
Copy link
Contributor

mikames commented Jun 29, 2022

I think the ProducerTimestamp needs to be in milliseconds not seconds can you try 'ProducerTimestamp': int(time.time())*1000 and see if you get the same result?

@jorgejgnz
Copy link
Author

jorgejgnz commented Jul 1, 2022

I tried providing timestamp in milliseconds in the start processor request but I'm getting the same result. If StopSelector is not provided in start request, the stream processor tries to start but it stops almost immediately after receiving the start request.

I assume timestamps are given in seconds as they are given in seconds in Kinesis Video Streams API. I couldn't find any documentation that specifies what format the producer timestamp should have in the start stream processor request.

Docs: API, CLI

@mikames
Copy link
Contributor

mikames commented Jul 1, 2022

@jorgejgnz can you email me directly (mikames@amazon.com) with your contact details so i can follow up. thanks

@bartlomiejgadzicki-digica

@mikames hi, any updates regarding this issue?

@mikames
Copy link
Contributor

mikames commented Jul 21, 2022

@bartlomiejgadzicki-digica , hey yes looks like it's my instructions setting up SNS were wrong i'm going to fix. here's the instructions on setting up SNS https://docs.aws.amazon.com/rekognition/latest/dg/streaming-labels-setting-up.html

@bartlomiejgadzicki-digica

It doesn't work either with Producer or real time timestamp :C

@mikames
Copy link
Contributor

mikames commented Jul 22, 2022

@bartlomiejgadzicki-digica please drop me an email mikames@amazon.com and i can help debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants