<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Nirbheek and all,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Forgive me to ask a silly question, how should I find out the latency of the pipeline on Win10?</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I have tried GST_DEBUG, or GST_TRACERS as I gathered from the web. If I understand it correctly, these 2 are environment variables, so I can't directly run them like what people do in linux:<br>
<blockquote style="margin-top:0;margin-bottom:0"><span style="color:rgb(25, 37, 39);font-family:"Segoe UI", "Segoe WP", Arial, Sans-Serif;font-size:17px;display:inline !important">GST_DEBUG="GST_TRACER:7" GST_TRACERS=latency gst-launch-1.0 ....</span><br>
</blockquote>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color:rgb(25, 37, 39);font-family:"Segoe UI", "Segoe WP", Arial, Sans-Serif;font-size:17px;display:inline !important"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(25, 37, 39); font-family: Calibri, Helvetica, sans-serif; font-size: 17px; display: inline !important;">So I set them as environment variables but still I don't see any trace output displayed:</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(25, 37, 39); font-family: Calibri, Helvetica, sans-serif; font-size: 17px; display: inline !important;">
<blockquote style="margin-top:0;margin-bottom:0"><i>C:\Users\angela>set GST_TRACERS="latency"</i>
<div><i><br>
</i></div>
<div><i>C:\Users\angela>set GST_DEBUG="GST_TRACER:7"</i></div>
<div><i><br>
</i></div>
<div><i>C:\Users\angela>gst-launch-1.0 mfvideosrc do-timestamp=TRUE device-name="Studio Camera" ! video/x-raw,width=1920,height=1080 ! queue ! videoconvert ! autovideosink</i></div>
<div><i>Use Windows high-resolution clock, precision: 1 ms</i></div>
<div><i>Setting pipeline to PAUSED ...</i></div>
<div><i><br>
</i></div>
<div><i>(gst-launch-1.0:16660): GStreamer-CRITICAL **: 15:35:26.989: gst_pad_query_caps: assertion 'GST_IS_PAD (pad)' failed</i></div>
<div><i><br>
</i></div>
<div><i>(gst-launch-1.0:16660): GStreamer-CRITICAL **: 15:35:26.995: gst_object_unref: assertion 'object != NULL' failed</i></div>
<div><i><br>
</i></div>
<div><i>(gst-launch-1.0:16660): GStreamer-CRITICAL **: 15:35:26.999: gst_caps_can_intersect: assertion 'GST_IS_CAPS (caps2)' failed</i></div>
<div><i><br>
</i></div>
<div><i>(gst-launch-1.0:16660): GStreamer-CRITICAL **: 15:35:27.012: gst_mini_object_unref: assertion 'mini_object != NULL' failed</i></div>
<div><i>Pipeline is live and does not need PREROLL ...</i></div>
<div><i>Got context from element 'autovideosink0': gst.d3d11.device.handle=context, device=(GstD3D11Device)"\(GstD3D11Device\)\ d3d11device5", adapter=(uint)0, adapter-luid=(gint64)67806, device-id=(uint)22813, vendor-id=(uint)32902, hardware=(boolean)true,
 description=(string)"Intel\(R\)\ HD\ Graphics\ P630";</i></div>
<div><i>Pipeline is PREROLLED ...</i></div>
<div><i>Setting pipeline to PLAYING ...</i></div>
<div><i>New clock: GstSystemClock</i></div>
<div><i>Redistribute latency...</i></div>
<div><i>ERROR: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstD3D11VideoSink:autovideosink0-actual-sink-d3d11video: Output window was closed</i></div>
<div><i>Additional debug info:</i></div>
<div><i>../sys/d3d11/gstd3d11videosink.cpp(1266): gst_d3d11_video_sink_show_frame (): /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstD3D11VideoSink:autovideosink0-actual-sink-d3d11video</i></div>
<div><i>ERROR: from element /GstPipeline:pipeline0/GstMFVideoSrc:mfvideosrc0: Internal data stream error.</i></div>
<div><i>Execution ended after 0:03:18.337586000</i></div>
<div><i>Setting pipeline to NULL ...</i></div>
<div><i>Additional debug info:</i></div>
<div><i>../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstMFVideoSrc:mfvideosrc0:</i></div>
<div><i>streaming stopped, reason error (-5)</i></div>
<div><i>Freeing pipeline ...</i><br>
</div>
</blockquote>
<div><i><br>
</i></div>
<div>Even if I set the GST_DEBUG_FILE environment variable, I can see the file is generated, but there is no content inside.</div>
<div><br>
</div>
<div>Can anyone advise how to see the latency of the pipeline in Win10?</div>
<div><br>
</div>
<div>Thank you,</div>
<div>Angela</div>
</span></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Nirbheek Chauhan <nirbheek.chauhan@gmail.com><br>
<b>Sent:</b> Friday, June 24, 2022 3:59 AM<br>
<b>To:</b> Discussion of the development of and with GStreamer <gstreamer-devel@lists.freedesktop.org><br>
<b>Cc:</b> Angela Yan <yanyan9@hotmail.com><br>
<b>Subject:</b> Re: Reduce latency on Win10 for AWS Kinesis Video</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi Angela,<br>
<br>
The ksvideosrc plugin uses the deprecated WinKS API. Try using<br>
mfvideosrc, that should perform better.<br>
<br>
You should also add some queues in your pipeline. Also note that you<br>
can use hardware accelerated encoding with the mfh264enc element. Both<br>
these elements belong to the mediafoundation plugin.<br>
<br>
Technically there's no reason for there to be 10s latency in capture +<br>
encode. It should be just a few hundred milliseconds. I would<br>
recommend measuring where the latency actually is, for example, what<br>
is the latency in this pipeline?<br>
<br>
mfvideosrc ! image/jpeg,width=1920,height=1080 ! jpegdec ! queue !<br>
videoconvert ! autovideosink<br>
<br>
Generally you will get JPEG from a USB camera, not YUV. If that's not the case:<br>
<br>
mfvideosrc ! video/x-raw,width=1920,height=1080 ! queue ! videoconvert<br>
! autovideosink<br>
<br>
Cheers,<br>
Nirbheek<br>
<br>
On Thu, Jun 23, 2022 at 2:45 PM Angela Yan via gstreamer-devel<br>
<gstreamer-devel@lists.freedesktop.org> wrote:<br>
><br>
> Hi all,<br>
><br>
> 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.<br>
><br>
> 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<br>
><br>
> Here is my pipeline:<br>
> 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"<br>
><br>
> Thank you,<br>
> Angela<br>
</div>
</span></font></div>
</body>
</html>