gstreamer1.19 debug

调试过程中,经常需要观察日志。
常规来说,只要打印在屏幕上。

如果要打印在日志文件里,那么要执行如下:
GST_DEBUG_FILE 是一个环境变量,指定gstreamer的debug文件

export GST_DEBUG_FILE=/tmp/gstreamer/log.log

参考:https://gstreamer.freedesktop.org/documentation/gstreamer/gstinfo.html?gi-language=c#gst_debug_log_default

gst_debug_log (GstDebugCategory * category,
               GstDebugLevel level,
               const gchar * file,
               const gchar * function,
               gint line,
               GObject * object,
               const gchar * format,
               ... ...
##file – the file that emitted the message, usually the FILE identifier

如果要打印出信息,那么设置GST_DEBUG 环境变量即可。比如设置GST_DEBUG=2

export GST_DEBUG=2

Basic tutorial 11: Debugging tools

Gstreamer官方教程11,详细的描述了如何设置GST_DEBUG环境变量
包括:设置全局的,指定element的或者加通配符的,或者如何查看debug信息的。

To enable debug output, set the GST_DEBUG environment variable to the desired debug level. All levels below that will also be shown (i.e., if you set GST_DEBUG=2, you will get both ERROR and WARNING messages).

Furthermore, each plugin or part of the GStreamer defines its own category, so you can specify a debug level for each individual category. For example, GST_DEBUG=2,audiotestsrc:6, will use Debug Level 6 for the audiotestsrc element, and 2 for all the others.

The GST_DEBUG environment variable, then, is a comma-separated list of category:level pairs, with an optional level at the beginning, representing the default debug level for all categories.

The '’ wildcard is also available. For example GST_DEBUG=2,audio:6 will use Debug Level 5 for all categories starting with the word audio. GST_DEBUG=*:2 is equivalent to GST_DEBUG=2.

Use gst-launch-1.0 --gst-debug-help to obtain the list of all registered categories. Bear in mind that each plugin registers its own categories, so, when installing or removing plugins, this list can change.

Use GST_DEBUG when the error information posted on the GStreamer bus does not help you nail down a problem. It is common practice to redirect the output log to a file, and then examine it later, searching for specific messages.

以下链接是CSDN上总结比较好的,关于gstreamer的debug信息,可以查看下。
感谢原作者
Gstreamer-LOG

注意:

如果Gstreamer的log一直无法输出或者无法写入log,要看下是否so用错了。

可以使用gst-launch-1.0 --gst-debug-help查一下。如果没有你想要的element,那就是so文件用错了.
ELEMENT没有正常加载

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值