0

On Raspberry Pi I run a client program written in Python. It communicates over tcp messages with the server. When the appropriate command comes from the server, the program starts the video transmission:

subprocess.check_call(['/home/pi/to_janus.sh'],shell = True)

While I start the client manually, video by command from the server is started. But if I set the start of client to rc.local, I get the following error messages, when the command comes from the server:

(gst-plugin-scanner:839): GLib-GObject-WARNING **: cannot register existing type 'GstOMXAudioSink'

(gst-plugin-scanner:839): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(gst-plugin-scanner:839): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(gst-plugin-scanner:839): GLib-GObject-CRITICAL **: g_type_register_static: assertion 'parent_type > 0' failed

(gst-plugin-scanner:839): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(The same messages I get if I try to run the video directly via rc.local). At the same time, the client successfully exchanges messages, and the result does not depend on how quickly the command to start transmitting video comes. I don't understand how the system knows that I started the client not manually, but through rc.local. And what I have to do to be able to work without manual loading.

to_janus.sh:

gst-launch-1.0 v4l2src ! image/jpeg,width=1280,height=480,framerate=20/1 ! jpegdec ! videoflip method=rotate-180 ! omxh264enc target-bitrate=1000000 control-rate=variable ! rtph264pay ! udpsink host=192.168.1.2 port=8004 sync=false
Kampi
  • 1,798
  • 18
  • 26
Vit Vikt
  • 11
  • 2
  • `shell=True` is an error (though you won't get an error message) when the argument is a list. You specifically want `shell=False` here. See also https://stackoverflow.com/questions/3172470/actual-meaning-of-shell-true-in-subprocess – tripleee Aug 29 '19 at 11:16
  • This looks like you are trying to launch an X11 program when there is not yet an X11 session. You will need to start the X server first. This is a common FAQ. – tripleee Aug 29 '19 at 11:17
  • Launch video after the startup of the program was working after add 2 lines: import gi gi.require_version('Gst', '1.0') – Vit Vikt Sep 03 '19 at 08:03

0 Answers0