{"id":1230,"date":"2024-03-02T16:32:44","date_gmt":"2024-03-02T08:32:44","guid":{"rendered":"https:\/\/www.fanyamin.com\/wordpress\/?p=1230"},"modified":"2024-03-03T16:55:24","modified_gmt":"2024-03-03T08:55:24","slug":"how-to-measure-qos-of-gstreamer","status":"publish","type":"post","link":"https:\/\/www.fanyamin.com\/wordpress\/?p=1230","title":{"rendered":"How to measure QoS of GStreamer"},"content":{"rendered":"<blockquote>\n<p>Elements that synchronize buffers on the pipeline clock will usually measure the current QoS. They will also need to keep some statistics in order to generate the QOS event.<\/p>\n<\/blockquote>\n<p>\u7f13\u51b2\u6570\u636e\u4e0e\u7ba1\u9053\u65f6\u949f\u4e4b\u95f4\u7684\u540c\u6b65\u901a\u5e38\u53ef\u4ee5\u7528\u6765\u8861\u91cf QoS<\/p>\n<blockquote>\n<p>For each buffer that arrives in the sink, the element needs to calculate how late or how early it was. This is called the jitter. Negative jitter values mean that the buffer was early, positive values mean that the buffer was late. the jitter value gives an indication of how early\/late a buffer was.<\/p>\n<\/blockquote>\n<p>\u6bcf\u4e00\u4efd\u7f13\u51b2\u6570\u636e\u5230\u8fbe\u63a5\u6536\u5668, \u5143\u4ef6\u90fd\u8981\u8ba1\u7b97\u5b83\u6709\u591a\u65e9\u6216\u591a\u8fdf, \u8fd9\u4e2a\u65f6\u95f4\u5dee\u79f0\u4e3a\u6296\u52a8  jitter<\/p>\n<p>Jitter \u4e3a\u8d1f\u503c\u8868\u793a\u7f13\u51b2\u6570\u636e\u6765\u65e9\u4e86, \u7f13\u51b2\u6570\u636e\u4e3a\u6b63\u503c\u8868\u793a\u6765\u8fdf\u4e86, \u4e5f\u5c31\u662f\u8bf4 jitter \u8868\u793a\u4e86\u7f13\u51b2\u6570\u636e\u6765\u5f97\u6709\u591a\u65e9\u6216\u8005\u591a\u8fdf<\/p>\n<blockquote>\n<p>A synchronizing element will also need to calculate how much time elapsed between receiving two consecutive buffers. <\/p>\n<\/blockquote>\n<p>\u4e00\u4e2a\u540c\u6b65\u5143\u4ef6\u4e5f\u4f1a\u9700\u8981\u8ba1\u7b97\u5728\u4e24\u4e2a\u8fde\u7eed\u7684\u7f13\u51b2\u6570\u636e\u4e4b\u95f4\u82b1\u8d39\u4e86\u591a\u957f\u65f6\u95f4<\/p>\n<blockquote>\n<p>We call this the processing time because that is the amount of time it takes for the upstream element to produce\/process the buffer. We can compare this processing time to the duration of the buffer to have a measurement of how fast upstream can produce data, called the proportion. If, for example, upstream can produce a buffer in 0.5 seconds of 1 second long, it is operating at twice the required speed. If, on the other hand, it takes 2 seconds to produce a buffer with 1 seconds worth of data, upstream is producing buffers too slow and we won't be able to keep synchronization. Usually, a running average is kept of the proportion.<\/p>\n<\/blockquote>\n<p>\u6211\u4eec\u5c06\u6b64\u79f0\u4e3a\u5904\u7406\u65f6\u95f4\uff0c\u56e0\u4e3a\u8fd9\u662f\u4e0a\u6e38\u5143\u7d20\u751f\u6210\/\u5904\u7406\u7f13\u51b2\u533a\u6240\u9700\u7684\u65f6\u95f4\u3002 \u6211\u4eec\u53ef\u4ee5\u5c06\u6b64\u5904\u7406\u65f6\u95f4\u4e0e\u7f13\u51b2\u533a\u7684\u6301\u7eed\u65f6\u95f4\u8fdb\u884c\u6bd4\u8f83\uff0c\u4ee5\u8861\u91cf\u4e0a\u6e38\u751f\u6210\u6570\u636e\u7684\u901f\u5ea6\uff0c\u79f0\u4e3a\u6bd4\u4f8b\u3002<br \/>\n\u4f8b\u5982\uff0c\u5982\u679c\u4e0a\u6e38\u53ef\u4ee5\u5728 0.5 \u79d2\u5185\u751f\u6210 1 \u79d2\u957f\u7684\u7f13\u51b2\u533a\uff0c\u5219\u5b83\u7684\u8fd0\u884c\u901f\u5ea6\u662f\u6240\u9700\u901f\u5ea6\u7684\u4e24\u500d\u3002 \u53e6\u4e00\u65b9\u9762\uff0c\u5982\u679c\u9700\u8981 2 \u79d2\u6765\u751f\u6210\u5305\u542b 1 \u79d2\u6570\u636e\u7684\u7f13\u51b2\u533a\uff0c\u5219\u4e0a\u6e38\u751f\u6210\u7f13\u51b2\u533a\u7684\u901f\u5ea6\u592a\u6162\uff0c\u6211\u4eec\u5c06\u65e0\u6cd5\u4fdd\u6301\u540c\u6b65\u3002 \u901a\u5e38\uff0c\u4fdd\u7559\u8be5\u6bd4\u4f8b\u7684\u79fb\u52a8\u5e73\u5747\u503c<\/p>\n<blockquote>\n<p>A synchronizing element also needs to measure its own performance in order to figure out if the performance problem is upstream of itself.<\/p>\n<\/blockquote>\n<p>\u540c\u6b65\u5143\u7d20\u8fd8\u9700\u8981\u6d4b\u91cf\u5176\u81ea\u8eab\u7684\u6027\u80fd\uff0c\u4ee5\u4fbf\u786e\u5b9a\u6027\u80fd\u95ee\u9898\u662f\u5426\u51fa\u5728\u5176\u81ea\u8eab\u7684\u4e0a\u6e38\u3002<\/p>\n<blockquote>\n<p>These measurements are used to construct a QOS event that is sent upstream. Note that a QoS event is sent for each buffer that arrives in the sink.<\/p>\n<\/blockquote>\n<p>\u8fd9\u4e9b\u6d4b\u91cf\u7ed3\u679c\u7528\u4e8e\u6784\u5efa\u5411\u4e0a\u6e38\u53d1\u9001\u7684 QOS \u4e8b\u4ef6\u3002 \u8bf7\u6ce8\u610f\uff0c\u6bcf\u4e2a\u5230\u8fbe\u63a5\u6536\u5668\u7684\u7f13\u51b2\u533a\u90fd\u4f1a\u53d1\u9001\u4e00\u4e2a QoS \u4e8b\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Elements that synchronize buffers on the pipeline clock will usually measure the current QoS. They will also need to keep some statistics in order to generate the QOS event. \u7f13\u51b2\u6570\u636e\u4e0e\u7ba1\u9053\u65f6\u949f\u4e4b\u95f4\u7684\u540c\u6b65\u901a\u5e38\u53ef\u4ee5\u7528\u6765\u8861\u91cf QoS For each buffer that arrives in the sink, the element needs to calculate how late or how early it was. This is called the [&hellip;] <a class=\"read-more\" href=\"https:\/\/www.fanyamin.com\/wordpress\/?p=1230\" title=\"Permanent Link to: How to measure QoS of GStreamer\">&rarr;Read&nbsp;more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1230","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1230"}],"collection":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1230"}],"version-history":[{"count":3,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1230\/revisions"}],"predecessor-version":[{"id":1233,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1230\/revisions\/1233"}],"wp:attachment":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}