Difference between revisions of "GstShark - Framerate tracer"

From RidgeRun Developer Connection
Jump to: navigation, search
Line 3: Line 3:
 
|next=[[GstShark - Schedule time tracer|Schedule time tracer]]
 
|next=[[GstShark - Schedule time tracer|Schedule time tracer]]
 
|name=framerate
 
|name=framerate
|description=The frame rate of a pipeline is one of the most useful characteristics, especially those one who include live video source elements, since it is normally a design parameter and a requirement for declaring the performance of a pipeline as successful; also, the frame rate is usually used for determining if the output of pipeline, in which there are video and audio involved, is synced. As its own name says frame rate is the measurement of the frame frequency, that means that it corresponds to the measurement of the amount of frames that go through the source pad of certain element every defined amount of time. Normally frame rate is expressed in frames per second (FPS). Therefore what the framerate tracer does is displaying the amount of frames that goes through every source pad of every element of the pipeline and it is updated and printed on the output log every second.
+
|description=The frame rate of a pipeline is one of the most useful characteristics when debugging, especially for those which include live video source elements. It is common that the frame rate is a design parameter and a requirement for declaring the performance of a pipeline as successful. Also, the frame rate is usually used for determining if the output of pipeline is synced, when both video and audio are involved. The frame rate is the measurement of the frame frequency, that means that it is the measurement of the number of frames that go through the source pad of certain element in a given time. Normally frame rate is expressed in frames per second (FPS).  
  
Frequently in a single threaded pipeline the measurements will match for every element of the pipeline but this cannot be taken for granted, there could be the case in which the frame rate of different elements do not match and this does not affect negatively the outcome of pipeline; i.e., in a multi-threaded pipeline the frame rate values might report differently at different points in the pipeline and still have a good performance. The typical scenarios where pipelines can be multi-threaded are: multiple source elements, queues, and elements which internally process asynchronously.
+
The framerate tracer displays the number of frames that go through every source pad of every element of the pipeline and it is updated and printed on the output log every second.
 +
 
 +
Frequently, in a single threaded pipeline, the measurements will match for every element of the pipeline but this cannot be taken for granted. There are cases in which the frame rates of different elements do not match and this does not affect negatively the outcome of pipeline. For example, in a multi-threaded pipeline, the frame rate values might be different at different points in the pipeline and still have a good performance. The typical scenarios where pipelines can be multi-threaded are: multiple source elements, queues, and elements which internally process asynchronously.
  
In order to exemplify how to use this tracer and result that the user might get from it, the following pipeline was used; the pipeline have only three elements, numbered from left to right, in which one of them is a sink element and because of the nature of the measurement and the tracer (frame rate is only measured on the source pads of the elements) the frame rate of this element is not being displayed. The elements are connected as the following graph shows and below that there is the pipeline with the output log obtained from it.
 
  
 
|graph=[[File:test_framerate.png|1000px|center]]
 
|graph=[[File:test_framerate.png|1000px|center]]
 
|pipeline=
 
|pipeline=
 +
The following pipeline shows the usage and results of using the framerate tracer. The pipeline has only three elements. The sink element is not being displayed in the logs, because of the nature of the measurement.
 +
 
<pre style="white-space:pre-wrap; width:100%;">
 
<pre style="white-space:pre-wrap; width:100%;">
 
GST_DEBUG="GST_TRACER:7" GST_TRACERS="framerate" gst-launch-1.0 videotestsrc ! videorate max-rate=15 ! fakesink sync=true
 
GST_DEBUG="GST_TRACER:7" GST_TRACERS="framerate" gst-launch-1.0 videotestsrc ! videorate max-rate=15 ! fakesink sync=true
 
</pre>
 
</pre>
 +
 +
A videorate element was used to set the framerate to a fixed value, which can be observed in the output log.
 
|output=
 
|output=
<font size=1>
+
<font size=2>
<pre>
+
<pre>0:00:06.619551614 14662      0x1db8400 TRACE             GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
0:00:01.229360710 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)21;
+
0:00:06.619592774 14662      0x1db8400 TRACE             GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;</pre>
0:00:01.229470965 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)20;
 
0:00:02.229603561 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;
 
0:00:02.229704469 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
 
0:00:03.229813070 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;
 
0:00:03.229931789 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
 
0:00:04.229094685 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;
 
0:00:04.229177391 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
 
0:00:05.229269122 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;
 
0:00:05.229311209 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
 
0:00:06.229392913 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;
 
0:00:06.229459998 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
 
0:00:07.229506584 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;
 
0:00:07.229543062 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
 
0:00:08.229586552 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;
 
0:00:08.229645689 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
 
0:00:09.229695974 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;
 
0:00:09.229738533 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
 
0:00:10.229795081 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;
 
0:00:10.229884141 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
 
0:00:11.229029697 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;
 
0:00:11.229109025 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
 
0:00:12.229201141 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;
 
0:00:12.229264451 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
 
0:00:13.229362416 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;
 
0:00:13.229399786 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
 
0:00:14.229519683 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;
 
0:00:14.229598836 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
 
0:00:15.229713012 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;
 
0:00:15.229755348 12840 0x18d5200 TRACE GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
 
</pre>
 
 
</font>
 
</font>
|closing=In this case the results obtained are easy to verify, the pipeline only has one source element which means it only has one thread of processing; therefore, every element on the pipeline should have the same frame rate and since one of the element was a filter with the functionality of setting the frame rate of the pipeline (set to a value of 15), every frame rate measurement done on every source pad of the pipeline has to be equal to value set on that element.
+
 
 +
Each log line provides a {{code|1=pad}} field with the source pad being measured and an {{code|1=fps}} field with the number of frames produced during the last second.
 +
 
 
}}
 
}}

Revision as of 13:55, 17 August 2017


Processing time tracer

Home

Schedule time tracer

The frame rate of a pipeline is one of the most useful characteristics when debugging, especially for those which include live video source elements. It is common that the frame rate is a design parameter and a requirement for declaring the performance of a pipeline as successful. Also, the frame rate is usually used for determining if the output of pipeline is synced, when both video and audio are involved. The frame rate is the measurement of the frame frequency, that means that it is the measurement of the number of frames that go through the source pad of certain element in a given time. Normally frame rate is expressed in frames per second (FPS).

The framerate tracer displays the number of frames that go through every source pad of every element of the pipeline and it is updated and printed on the output log every second.

Frequently, in a single threaded pipeline, the measurements will match for every element of the pipeline but this cannot be taken for granted. There are cases in which the frame rates of different elements do not match and this does not affect negatively the outcome of pipeline. For example, in a multi-threaded pipeline, the frame rate values might be different at different points in the pipeline and still have a good performance. The typical scenarios where pipelines can be multi-threaded are: multiple source elements, queues, and elements which internally process asynchronously.

Pipeline

The following pipeline shows the usage and results of using the framerate tracer. The pipeline has only three elements. The sink element is not being displayed in the logs, because of the nature of the measurement.

GST_DEBUG="GST_TRACER:7" GST_TRACERS="framerate" gst-launch-1.0 videotestsrc ! videorate max-rate=15 ! fakesink sync=true

A videorate element was used to set the framerate to a fixed value, which can be observed in the output log.

Sample diagram

Test framerate.png

Output

0:00:06.619551614 14662      0x1db8400 TRACE             GST_TRACER :0:: framerate, pad=(string)videorate0_src, fps=(uint)15;
0:00:06.619592774 14662      0x1db8400 TRACE             GST_TRACER :0:: framerate, pad=(string)videotestsrc0_src, fps=(uint)15;

Each log line provides a pad field with the source pad being measured and an fps field with the number of frames produced during the last second.


Processing time tracer

Home

Schedule time tracer