2

I have a video processing daemon (python), which runs several processes, some of which use GStreamer to get raw video frames to my custom elements (C). Some of the processes "freezes" (Process is_alive() = True, but Gstreamer pipeline doesn't do anything and doesn't call any python callbacks) - usually after 2-10 days, and only in production. I was unable to replicate this on my computer.

Now I have log files from python logging (main program) and glib logging (C plugin), but there is nothing helpful, even after I've added a lot more logging messages everywhere. So I hope there would be some clue in GStreamer's messages.

I run glib "main loop" in processes dedicated to video processing and then send messages with results using multiprocessing.Queue for further processing to another process. These gst/video-processes are a bit alien to python - there are a lot of callbacks from gstreamer and other gstreamer weirdnesses. Thats why I've isolated them in separate processes.

I have some python logging in the callbacks and a lot of glib logging in C plugin, but It's clearly not enough. Something probably fails between python program and C element. So I really need to see what's going on in GStreamer's guts.

Unfortunately, it seems to me that there is no way to debug Gstreamer other than by intercepting stderr.

I've tried to run the program without daemonization, set GST_DEBUG and store stderr into a gzipped file, but it doesn't help much, because I get all GStreamer messages mixed up in one HUGE file.

To sum this up:

  • I have a daemon (therefore no stderr, no stdout)
  • In the daemon, I have many child processes
  • Some of them (14 of them actually) run GStreamer pipelines
  • I have some mystery failures
  • I need GStreamer debug output badly
  • But I need GStreamer messages from each process written to a different file so I won't get lost in them
  • I don't know how to do this.

As suggested in comments, I could use GST_DEBUG_FILE env.variable, but that works from GStreamer 0.10.31. I have 0.10.30 so I can't use it.
Or I could write custom log handler, but since it would have to be written in python and `gst_debug_log_default' is not accesible from python bindings, this won't work either (maybe I'm wrong).

Jan Spurny
  • 5,219
  • 1
  • 33
  • 47

1 Answers1

2

You will have write your own log handler. Here is a similar question and its answer. Please see if this helps.

Community
  • 1
  • 1
user2618142
  • 1,035
  • 2
  • 18
  • 35
  • Thanks, it seems that the `GST_DEBUG_FILE` environment variable was what I was looking for - it's surprisingly hard to find in any GStreamer documentation - unfortunately, it seems that it is not supported in my GStreamer version (0.10). As for writing custom handler - I'd have to write it in python, and that seems to be impossible (no python binding for `gst_debug_log_default`) :( – Jan Spurny Oct 21 '13 at 11:49
  • Documentation says that `GST_DEBUG_FILE` is supported from version 0.10.31. I have 0.10.30. – Jan Spurny Oct 21 '13 at 11:55
  • Well even if it doesn't help me as much as I've hoped for, it IS the only viable solution. – Jan Spurny Oct 21 '13 at 15:37