How to use properties on gstreamer

人盡茶涼 提交于 2021-01-28 06:09:37

问题


I am new using g streamer, and i try to use the emit-stats properties in tsdemux

How can I do to use this in my pipeline?

I'm trying to get the program clock reference value of a signal transport stream but no way to get it.


回答1:


Properties in GStreamer are normally accessed by using the normal GLib APIs : g_object_set and g_object_get. Doing g_object_set (v1_demux, "emit-stats", TRUE, NULL);, supposing that v1_demux is a GstTSDemux*, will start emitting messages containing the PTS and DTS of the packets that flow into the demuxer.

Element messages in GStreamer are emitted by gst_element_post_message. In order to receive them in your application, it needs to set up a bus watch on the main pipeline's GstBus.

Just for the record, you can test how the property works and see the content of the messages by running this example pipeline in gst-launch :

gst-launch-1.0 -m filesrc location="$YOUR_TRANSPORT_STREAM" ! tsdemux emit-stats=1 ! fakesink

Running this with one of the transport streams on my HDD, I can see messages with the PTS and DTS being emitted from the demuxer element :

Got message #77 from element "tsdemux0" (element): tsdemux, pid=(uint)1803, offset=(guint64)266020, pts=(guint64)8429319339;
Got message #78 from element "tsdemux0" (element): tsdemux, pid=(uint)1805, offset=(guint64)273540, pts=(guint64)8429311261;
Got message #79 from element "tsdemux0" (element): tsdemux, pid=(uint)1802, offset=(guint64)282564, dts=(guint64)8429444461;

However, it doesn't look like PCR and OPCR values are emitted. You'll have to add this functionality yourself.




回答2:


Thanks for the info.

was test commands and see the script and check the values, but is costing me add messages emit-stats in my line.

If I created a bus watch on the main pipeline's GstBus,to see the video duration and as playtime in my line, but can not see messages stats and video simultaneously. I still investigating comohacerlo as storing information pts and dts in some way.

My idea is get stamps of two videos and subtract this to calculate an automatic offset in one video.



来源:https://stackoverflow.com/questions/28973081/how-to-use-properties-on-gstreamer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!