在命令前面加上:GST_DEBUG="GST_TRACER:7" GST_TRACERS="leaks"
在断开或者退出命令的时候就会出现一些如下内容:
0:00:14.401430874 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f8c0325a0, description=(string)buffer: 0x7f8c0325a0, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:14.401468331 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f8c0266c0, description=(string)buffer: 0x7f8c0266c0, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:14.401505349 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f8c00e900, description=(string)buffer: 0x7f8c00e900, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:14.401543226 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f8c02f360, description=(string)buffer: 0x7f8c02f360, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:14.401580354 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f8c038000, description=(string)buffer: 0x7f8c038000, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:14.401617761 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f8c02c120, description=(string)buffer: 0x7f8c02c120, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:14.401654719 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f8c03cea0, description=(string)buffer: 0x7f8c03cea0, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:14.401692336 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f8c042900, description=(string)buffer: 0x7f8c042900, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:14.401729644 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f8c036a20, description=(string)buffer: 0x7f8c036a20, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:14.401767471 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f8c03f6c0, description=(string)buffer: 0x7f8c03f6c0, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:14.401804629 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f8c03c480, description=(string)buffer: 0x7f8c03c480, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:14.401842126 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f8c0096c0, description=(string)buffer: 0x7f8c0096c0, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:14.401879564 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f8c036000, description=(string)buffer: 0x7f8c036000, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:14.401927318 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f8c010360, description=(string)buffer: 0x7f8c010360, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:14.401966355 1117 0x5582597a90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x5582610900, description=(string)buffer: 0x5582610900, pts 99:99:99.999999999, dts 0:00:00.000000000, dur 99:99:99.999999999, size 0, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
说明有内存泄漏,再排查问题