[QUESTION] One master and one channel. Different video streams to clients. Hack or option? Re-send buffers problem.
Hi! I'm trying to send different video streams on demand to each client (for example session0 and session1) of master. And it works. But when re-send happens frequently (because of bad 4G connection) some of buffers from session0 goes to session1 client and vice versa. Clients are based on awslabs/amazon-kinesis-video-streams-webrtc-sdk-js.
** Logging ** SDK c++ version from this commit:
commit d08634bda8b32b0e9993a83835c4f0481c060abd (HEAD -> master, origin/master, origin/HEAD)
Author: Kevin Allen <[email protected]>
Date: Tue Sep 14 09:49:43 2021 -0400
Fix scripts/pare_status.py for non-status #defines (#1268)
** Any design considerations/constraints **
I have embedded solution based on Freescale iMX.6. So SDK is compiled for it. The target system is: Linux - - cortexa9hf-neon-poky. Compiled with flags "-mfloat-abi=hard -mfpu=neon".
I have 2 video buffers sources (source0 and source1) based on gstreamer. One for session0 and one for session1.
I have modified kvsWebRTCClientMasterGstreamerSample.c function GstFlowReturn on_new_sample(GstElement* sink, gpointer data, UINT64 trackid) to check which incoming buffer for which session to send.
When I send source0 to session0 and session1 - OK. At lest it's hard to check on re-send because same source. When I send source1 to session0 and session1 - OK When I send source0 to session0 adn source1 to session1 - NOT OK. When frequent re-send packets happens, some of buffers from source0 goes to session1 and vice versa: from source1 goes to session0.
I've listed Rtp.c code and found that for each sampleStreamingSession corresponding RollingBuffer is created. So I'm tried to imagine how it's possible that source0 buffers could be sent to not only session0. And I have no idea.
Master is connected to 4G router and goes to Internet through mobile ISP. Connection with clients is through relay aws server. Clients have connection to local wired ISP.
I've tried to change jitter buffer latency from 2000ms to 80. No effect.
Also changed DEFAULT_ROLLING_BUFFER_DURATION_IN_SECONDS from 3 to 5
and HIGHEST_EXPECTED_BIT_RATE from (10 * 1024 * 1024) to (20 * 1024 * 1024) to enlarge RollingBuffer capacity - no change.
Bitrate of source0 and source1 is about 1MBit\s but different image with different width\height - so I could clearly see buffer's mess on client's side.
So the main question is: is it possible for SDK to use different video sources for different clients on one master (with one signalling channel active)? Is it possible that rolling buffers could be overlapped or something so sending to sessions could be corrupted.
This is a very old issue. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one.
This is a very old issue. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one.
Each transceiver has a unique rolling buffer, so that wouldn't be the issue. The issue would be that you would need a unique KvsPeerConnection object for each source so that you have a unique iceAgent and unique socket. Otherwise writeFrame() can't distinguish between the sessions.
Hello again! I've checked it with newer version v1.8.1 (before it was v.1.6.0+). But suddenly the Bug on our side was found. So there was never such a problem with SDK itself. Thank you for your attention!