Reduce latency on Win10 for AWS Kinesis Video

Nirbheek Chauhan nirbheek.chauhan at gmail.com
Thu Jun 23 19:59:43 UTC 2022


Hi Angela,

The ksvideosrc plugin uses the deprecated WinKS API. Try using
mfvideosrc, that should perform better.

You should also add some queues in your pipeline. Also note that you
can use hardware accelerated encoding with the mfh264enc element. Both
these elements belong to the mediafoundation plugin.

Technically there's no reason for there to be 10s latency in capture +
encode. It should be just a few hundred milliseconds. I would
recommend measuring where the latency actually is, for example, what
is the latency in this pipeline?

mfvideosrc ! image/jpeg,width=1920,height=1080 ! jpegdec ! queue !
videoconvert ! autovideosink

Generally you will get JPEG from a USB camera, not YUV. If that's not the case:

mfvideosrc ! video/x-raw,width=1920,height=1080 ! queue ! videoconvert
! autovideosink

Cheers,
Nirbheek

On Thu, Jun 23, 2022 at 2:45 PM Angela Yan via gstreamer-devel
<gstreamer-devel at lists.freedesktop.org> wrote:
>
> Hi all,
>
> I am running gstreamer on Win 10 to stream from a high res camera to AWS Kinesis Video stream through the AWS producer plugin (KVSSink). However, we found significant delay in the whole process. Around ~10 sec delay, with 60% on gstreamer to AWS and 40% on AWS to player.
>
> I have tried added tune=zerolatency on the encoder, which seems to reduce 2s of the latency. Then speed-preset=ultrafast seems no help on the latency. Anyone can advise how to further reduce the latency on gStreamer pipeline? I am new to gStreamer. Hit lightly if I make any mistakes. :p
>
> Here is my pipeline:
> gst-launch-1.0 ksvideosrc do-timestamp=TRUE device-name="Studio Camera" ! video/x-raw,width=1920,height=1080,framerate=30/1 ! videoconvert ! x264enc bframes=0 key-int-max=45 bitrate=4096 tune=zerolatency speed-preset=ultrafast ! video/x-h264,profile=baseline,stream-format=avc,alignment=au ! kvssink stream-name="ANGELA-Stream" access-key="xxx" secret-key="xxx" aws-region="xxx"
>
> Thank you,
> Angela


More information about the gstreamer-devel mailing list