Configure Gstream OMX plugins to run with gst-python

I’m trying to run a python app that uses omxh264enc, but I receive this error when I try to initiate the plugin:

0:00:23.812035601 18170       0xda0390 WARN                     omx gstomx.c:2826:plugin_init: Failed to load configuration file: Valid key file could not be found in search dirs (searched in: /home/nvidia/.config:/etc/xdg as per GST_OMX_CONFIG_DIR environment variable, the xdg user config directory (or XDG_CONFIG_HOME) and the system config directory (or XDG_CONFIG_DIRS)

The python code is:

def start_record(self):
        # Filename (current time)
        filename ="%Y-%m-%d_%H.%M.%S") + ".mp4"

        # record pipe line
        # t. ! omxh264enc bitrate=10000000 ! h264parse ! mp4mux ! filesink location=test.mp4 -e
        self.rec_pipeline ="rec_pipe")

        self.queue_rec = Gst.ElementFactory.make("queue", "queueRec")

        h264enc = Gst.ElementFactory.make("omxh264enc", "h264enc")
        h264enc.set_property("bitrate", 10000000)

        h264parse = Gst.ElementFactory.make("h264parse")

        mp4mux = Gst.ElementFactory.make("mp4mux")

        filesink = Gst.ElementFactory.make("filesink")
        filesink.set_property("location", filename)


Anyone knows how I specific this configuration file?


It seems you miss source in your code. You may check if you can run videotestsrc first.

$ gst-launch-1.0 videotestsrc num-buffers=300 ! omxh264enc ! h264parse ! mp4mux ! filesink location=test.mp4

It is an “append” pipeline, I have a main pipeline that shows a video from cameras. When user click on a button (record) I append this to the main pipeline and (hope to) start record the video.
Trying to use “Gst.parse_bin_from_description(“queue name=filequeue ! omxh264enc bitrate=10000000 ! h264parse ! mp4mux ! filesink location=” + filename, True)” works but the video recorded is scrambled, anyway the “omx gstomx.c:2826:plugin_init: Failed to load configuration file” stil appears…
Any suggestion?


The print should be harmless. It is in default code of gst-omx-1.0.0 and we don’t modify it.
The default gst-omx is at

We modify it to support hardware acceleration. It is also open source code in

Not sure but it is more like an issue in the source. Can the issue be reproduced with default camera board ov5693?