awslabs / amazon-kinesis-video-streams-webrtc-sdk-c

Amazon Kinesis Video Streams Webrtc SDK is for developers to install and customize realtime communication between devices and enable secure streaming of video, audio to Kinesis Video Streams.
https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-c/group__PublicMemberFunctions.html
Apache License 2.0
1.02k stars 307 forks source link

Trying to connect jetson nano as a viewer using the SDK viewer sample but it doesn't show real stream in KVS test page #1093

Closed rahulvk05 closed 3 years ago

rahulvk05 commented 3 years ago

Trying to connect jetson nano as a viewer using the SDK viewer sample but it doesn't show real stream in KVS test page Logging from Jetson nano as viewer with verbose level 2 2021-03-09 05:56:10 DEBUG iceAgentLogNewCandidate(): New local ice candidate discovered. Id: LPnAeB1M9. Ip: 192.168.6.203:39394. Type: host. Protocol: UNKNOWN. 2021-03-09 05:56:10 INFO signalingClientSendMessageSync(): Signaling Client Sending Message Sync 2021-03-09 05:56:10 DEBUG sendLwsMessage(): Sending data over web socket: Message type: ICE_CANDIDATE, RecepientId: ConsumerViewer 2021-03-09 05:56:10 DEBUG lwsWssCallbackRoutine(): Client is writable 2021-03-09 05:56:10 DEBUG iceAgentGatherCandidateTimerCallback(): Candidate gathering completed. 2021-03-09 05:56:10 DEBUG iceAgentLogNewCandidate(): New local ice candidate discovered. Id: C8TxI8ypL. Ip: 182.73.138.8:52549. Type: srflx. Protocol: UNKNOWN. 2021-03-09 05:56:10 INFO signalingClientSendMessageSync(): Signaling Client Sending Message Sync 2021-03-09 05:56:10 DEBUG sendLwsMessage(): Sending data over web socket: Message type: ICE_CANDIDATE, RecepientId: ConsumerViewer 2021-03-09 05:56:10 DEBUG lwsWssCallbackRoutine(): Client is writable 2021-03-09 05:56:10 DEBUG onIceCandidateHandler(): ice candidate gathering finished 2021-03-09 05:56:17 DEBUG iceAgentCheckPeerReflexiveCandidate(): New remote peer reflexive candidate found 2021-03-09 05:56:17 DEBUG iceAgentLogNewCandidate(): New remote ice candidate discovered. Id: CmQxuR72L. Ip: 192.168.6.204:51541. Type: prflx. Protocol: UNKNOWN. 2021-03-09 05:56:17 ERROR dtlsSessionProcessPacket(): operation returned status code: 0x59000004 2021-03-09 05:56:17 ERROR dtlsSessionProcessPacket(): operation returned status code: 0x59000004 2021-03-09 05:56:17 DEBUG receiveLwsMessage(): Client received message of type: SDP_ANSWER 2021-03-09 05:56:17 DEBUG lwsWssCallbackRoutine(): Client is writable 2021-03-09 05:56:17 DEBUG stepStateMachine(): State Machine - Current state: 0x0000000000000001, Next state: 0x0000000000000002 2021-03-09 05:56:17 DEBUG iceAgentCheckConnectionStateSetup(): ice candidate pair count 2 2021-03-09 05:56:17 DEBUG stepIceAgentStateMachine(): Ice agent state changed from ICE_AGENT_STATE_NONE to ICE_AGENT_STATE_CHECK_CONNECTION. 2021-03-09 05:56:17 INFO onConnectionStateChange(): New connection state 2 2021-03-09 05:56:17 DEBUG handleStunPacket(): Ice candidate pair LPnAeB1M9_CmQxuR72L is connected. Round trip time: 2ms 2021-03-09 05:56:17 DEBUG receiveLwsMessage(): Client received message of type: ICE_CANDIDATE 2021-03-09 05:56:17 DEBUG lwsWssCallbackRoutine(): Client is writable 2021-03-09 05:56:17 DEBUG stepStateMachine(): State Machine - Current state: 0x0000000000000002, Next state: 0x0000000000000004 2021-03-09 05:56:17 DEBUG stepIceAgentStateMachine(): Ice agent state changed from ICE_AGENT_STATE_CHECK_CONNECTION to ICE_AGENT_STATE_CONNECTED. 2021-03-09 05:56:17 INFO onConnectionStateChange(): New connection state 1 2021-03-09 05:56:17 INFO onConnectionStateChange(): New connection state 3 2021-03-09 05:56:17 DEBUG rtcPeerConnectionGetMetrics(): ICE local candidate Stats requested at 16152693772493xxx 2021-03-09 05:56:17 DEBUG logSelectedIceCandidatesInformation(): Local Candidate IP Address: 192.168.6.xxx 2021-03-09 05:56:17 DEBUG logSelectedIceCandidatesInformation(): Local Candidate type: host 2021-03-09 05:56:17 DEBUG logSelectedIceCandidatesInformation(): Local Candidate port: 39xxx 2021-03-09 05:56:17 DEBUG logSelectedIceCandidatesInformation(): Local Candidate priority: 2130706xxx 2021-03-09 05:56:17 DEBUG logSelectedIceCandidatesInformation(): Local Candidate transport protocol: transport=udp 2021-03-09 05:56:17 DEBUG logSelectedIceCandidatesInformation(): Local Candidate relay protocol: N/A 2021-03-09 05:56:17 DEBUG logSelectedIceCandidatesInformation(): Local Candidate Ice server source: N/A 2021-03-09 05:56:17 DEBUG rtcPeerConnectionGetMetrics(): ICE remote candidate Stats requested at 1615269377249xxx 2021-03-09 05:56:17 DEBUG logSelectedIceCandidatesInformation(): Remote Candidate IP Address: 192.168.6.xxx 2021-03-09 05:56:17 DEBUG logSelectedIceCandidatesInformation(): Remote Candidate type: prflx 2021-03-09 05:56:17 DEBUG logSelectedIceCandidatesInformation(): Remote Candidate port: 51xxx 2021-03-09 05:56:17 DEBUG logSelectedIceCandidatesInformation(): Remote Candidate priority: 1853824xxx 2021-03-09 05:56:17 DEBUG logSelectedIceCandidatesInformation(): Remote Candidate transport protocol: transport=udp 2021-03-09 05:56:17 INFO onSctpInboundPacket(): Unhandled PPID on incoming SCTP message 0 2021-03-09 05:56:17 DEBUG stepStateMachine(): State Machine - Current state: 0x0000000000000004, Next state: 0x0000000000000008 2021-03-09 05:56:17 DEBUG iceAgentNominateCandidatePair(): Nominating candidate pair 2021-03-09 05:56:17 DEBUG stepIceAgentStateMachine(): Ice agent state changed from ICE_AGENT_STATE_CONNECTED to ICE_AGENT_STATE_NOMINATING. 2021-03-09 05:56:17 DEBUG stepStateMachine(): State Machine - Current state: 0x0000000000000008, Next state: 0x0000000000000010 2021-03-09 05:56:17 DEBUG iceAgentReadyStateSetup(): Selected pair LPnAeB1M9_CmQxuR72L, local candidate type: host. Round trip time 0 ms. Local candidate priority: 2130706431, ice candidate pair priority: 7962116751041232894 2021-03-09 05:56:17 DEBUG iceAgentReadyStateSetup(): Freeing Turn allocations that are not selected. Total turn allocation count 0 2021-03-09 05:56:17 DEBUG stepIceAgentStateMachine(): Ice agent state changed from ICE_AGENT_STATE_NOMINATING to ICE_AGENT_STATE_READY. 2021-03-09 05:56:17 DEBUG dtlsSessionChangeState(): DTLS init completed. Time taken 100 ms 2021-03-09 05:56:20 DEBUG lwsWssCallbackRoutine(): Client is writable

Master Log____ using KVS Test Page [2021-03-09T06:16:52.240Z] [INFO] Page loaded [2021-03-09T06:17:03.601Z] [INFO] [VIEWER] Channel ARN: arn:aws:kinesisvideo:ap-south-1:265284729442:channel/xxx/1606976591017 [2021-03-09T06:17:03.671Z] [INFO] [VIEWER] Endpoints: { "HTTPS": "https://r-xx.kinesisvideo.ap-south-1.amazonaws.com", "WSS": "wss://v-xx.kinesisvideo.ap-south-1.amazonaws.com" } [2021-03-09T06:17:04.380Z] [INFO] [VIEWER] ICE servers: [ { "urls": "stun:stun.kinesisvideo.ap-south-1.amazonaws.com:443" }, { "urls": [ "turn:13-233-124-137.t-xx.kinesisvideo.ap-south-1.amazonaws.com:443?transport=udp", "turns:13-233-124-137.t-xx.kinesisvideo.ap-south-1.amazonaws.com:443?transport=udp", "turns:13-233-124-137.t-xx.kinesisvideo.ap-south-1.amazonaws.com:443?transport=tcp" ], "username": "xxxx", "credential": "xxxx" }, { "urls": [ "turn:13-232-55-7.t-xx.kinesisvideo.ap-south-1.amazonaws.com:443?transport=udp", "turns:13-232-55-7.t-xx.kinesisvideo.ap-south-1.amazonaws.com:443?transport=udp", "turns:13-232-55-7.t-xx.kinesisvideo.ap-south-1.amazonaws.com:443?transport=tcp" ], "username": "xxxx", "credential": xxxx" } ] [2021-03-09T06:17:04.382Z] [INFO] [VIEWER] Starting viewer connection [2021-03-09T06:17:05.003Z] [INFO] [VIEWER] Connected to signaling service [2021-03-09T06:17:06.117Z] [INFO] [VIEWER] Creating SDP offer [2021-03-09T06:17:06.124Z] [INFO] [VIEWER] Sending SDP offer [2021-03-09T06:17:06.124Z] [INFO] [VIEWER] Generating ICE candidates [2021-03-09T06:17:06.126Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.127Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.128Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.128Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.227Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.227Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.236Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.238Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.275Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.275Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.286Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.286Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.288Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.289Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.322Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.322Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.340Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.341Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.406Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.406Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.605Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.606Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.606Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.606Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.607Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.607Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.608Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.608Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.653Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.653Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.654Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.654Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.670Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.670Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:06.698Z] [INFO] [VIEWER] Generated ICE candidate [2021-03-09T06:17:06.698Z] [INFO] [VIEWER] Sending ICE candidate [2021-03-09T06:17:46.141Z] [INFO] [VIEWER] All ICE candidates have been generated

Any design considerations/constraints Plan to use jetson nano as a viewer to send real stream to mobile app

Jetson nano as master working fine but failed to working as viewer

hassanctech commented 3 years ago

Can you please confirm which version of the SDK you're using? If you're not using the latest one, please pick up the latest one.

I want to understand your setup so you have Jetson Nano as viewer which isn't working. In this setup what is the master, is it the test page: https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-js/examples/index.html or another Jetson Nano or something else?

I did just try a sample the js sample test page on my macbook pro as Master and then I opened the same page on my iPhone as Viewer and I was able to see both video streams on both sides, so you should definitely be able to do the same with Jetson Nano as viewer and JS page as Master.

Once you provide more details about your setup we can further debug.

hassanctech commented 3 years ago

Also what OS are you using on the Jetson Nano.

rahulvk05 commented 3 years ago

Am using Jetson nano as a viewer by using SDK Viewer example with USB webcam and Run master in my laptop which is windows using KVS test page

For jetson nano am using 4GB model with Jetpack4.5.1 OS

disa6302 commented 3 years ago

@rahulvk05 , We do not have a Jetson to reproduce this. What is the order in which the master and viewer are started? Also, to ensure this is not platform specific, can you run the sample and test page on a usual Linux box?

rahulvk05 commented 3 years ago

Ok fine the master were first started at the laptop using test page and then the viewer were started in the jetson by using Sample C Program this is the order i did it shows the error as i mentioned above but when i ran master from the jetson using sample c program and run viewer in my laptop using test page it works perfectly

At the same time when i ran viewer by using testpage on jetson and master on the laptop using testpage it's working fine and At the same time when i ran master by using testpage on jetson and viewer on the laptop using testpage it's working fine

so this is working platform i think so

disa6302 commented 3 years ago

@rahulvk05 ,

My bad. I missed mentioning something. The goal of the viewer is to listen to frames in transceiverOnFrame callback. It is upto the application to process the frames. Viewer does not send any media, so you would not see any real stream.

kingsjakal commented 3 years ago

@disa6302 How to send the video and audio from kinesis viewer to master using c sdk

MushMal commented 3 years ago

This thread is diverging into an unrelated topics. The SDK itself does not send anything. Your application should create a transceiver and provide input to it - similar to the master sample. Our viewer sample simply is not designed to stream anything but rather simply consumes it. You can check the GStreamer sample too.

disa6302 commented 3 years ago

Assuming question is answered. Closing