Comments (4)
Hi Rob,
Can you describe what your media pipeline looks like? Is this a GStreamer pipeline? If so, take a look at the sample gstreamer application included in the SDK. There is a Key-frame fragmentation value you can modify:
g_object_set(G_OBJECT (data.encoder), "bframes", 0, "key-int-max", 45, "bitrate", 512, NULL);
This tells the encoder to generate an Idr frame every 45th frame. The frame rate is configured as 30fps, which means that in this case it will generate a fragment with 1.5 seconds duration.
from amazon-kinesis-video-streams-producer-sdk-cpp.
@dogtownmedia I would try to answer your question by first asking what you mean by the latency? If you refer to the amount of time it takes from the frame being captured to the time it gets rendered in the console video playback screen then we can dissect it into two very separate parts.
- The amount of time it takes (the latency) for the buffered frame to be sent to the KVS service backend.
- The amount of time it takes for the console to actually render it
- The amount of time it takes for the frames first bit to travel through the Real-time path of the backend and out to the consumer.
Let's discuss 2) first. Console playback IS NOT a real-time playback - it's more of an HLS/MPEG-DASH type of playback which is based on the fragments. So, there is the fragment duration which is an inherent latency (as the fragment needs to be ingested first), then, as the console playback streams only from the persistent storage, it will have to be first stored, indexed and then de-indexed and retrieved from the storage, adapted/trans-packaged to MPEG and send to the console for the playback. On the console side, many of the MSE implementations of the browser have an inherent buffer so it also affects the latency.
-
The latency here is primarily dependent upon your stream density and the network throughput. You can lower the FPS at the source, increase the compression rate of the encoder and/or cap the resolution lower. In order to understand the buffer pressures, please take a note in the log for the stream metrics printout - those are being outputed for every key-frame. You can see things like the current frame rate, transfer rate but more importantly for this case - the Current view duration - if it's 0 or a single frame depth duration then you have adequate networking bandwidth/latency.
-
We are constantly optimizing the overall throughput of the end-to-end system.
If you want to lower the latency of the the console playback then one of the options is to configure the media pipeline to produce shorter fragment durations.
If you intend to have a "Real-time" playback then the console playback is not very suitable - we are working on providing easy means for the Real-time playback on the consumer side. However, if you implemented your own consumer which uses the Parser Library to get the elementary stream to later be sent to some playback engine then we should look at the latency of the playback engine. Depending on the playback engine, the decoder/renderer might have their own buffering requirements which would add up to the overall latency.
Please help us understand better your scenario.
from amazon-kinesis-video-streams-producer-sdk-cpp.
Hi @MushMal sorry for the vague question.
I'm starting to understand how things work now.
Could you tell me how to configure the media pipeline to produce shorter fragment durations.
Thanks
Rob.
from amazon-kinesis-video-streams-producer-sdk-cpp.
That's exactly what i was after, thanks
from amazon-kinesis-video-streams-producer-sdk-cpp.
Related Issues (20)
- [QUESTION] Gstreamer event/message for streaming/connection releated issues in KVS SDK HOT 2
- [QUESTION] kvs_gstreamer_sample hanging after "pad link successful" HOT 1
- compilation error on Ubuntu HOT 1
- [QUESTION] Struggling with KVS streams on iOS HOT 6
- Not able to access media on Media Playback on Kinesis Video Streamer
- [QUESTION] Raspberry Pi からの映像送信でエラーが発生
- I am getting this error while running: cmake -DBUILD_GSTREAMER_PLUGIN=TRUE .. HOT 4
- [BUG] Streaming h.265 video from RTSP HOT 5
- [BUG] HOT 1
- [BUG] Gst plugin kvssink is built as static library
- [FEATURE] Make log level in kvssink configurable. HOT 1
- [BUG] `kvssink` occasionally generates non-monotonic PTS HOT 1
- How to resolve a "MAX_FRAGMENT_DURATION_REACHED" error when trying to stream RTSP camera feed into KVS HOT 3
- Failed to allocate memory HOT 3
- [BUG] HOT 1
- Stream video to your Kinesis video stream and view the live stream HOT 5
- [BUG] KVS Fails to build due to Threadpool.c.o issue HOT 4
- kvs_gstreamer_sample fails to run on Raspberry Pi bookworm
- [QUESTION] Streaming MP4 file data to Kinesis Video Streams results in Transferred a partial file error with CURL HOT 1
- [BUG] "Make" resulting in "incompatible pointer to integer conversion" Errors HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-kinesis-video-streams-producer-sdk-cpp.