Could not link timeoverlay0 to omxh264enc-omxh264enc0 error on TX2

Hi all,
I’m trying to put a timeoverlay in a h264 stream with a command like:

gst-launch-1.0 videotestsrc ! 'video/x-raw(memory:NVMM), width=(int)600, height=(int)600, format=(string)I420, framerate=(fraction)30/1' ! timeoverlay ! omxh264enc control-rate=2 bitrate=4000000 ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! rtph264pay mtu=1400 ! udpsink host=192.168.11.47 port=5000 sync=false async=false

But it shows :

WARNING: erroneous pipeline: could not link timeoverlay0 to omxh264enc-omxh264enc0

And i would like to know why?
And if there is a way to link timeoverlay to omx encoder.

Thank you in advance for your help!

If you run

gst-inspect-1.0 videotestsrc

you’ll see it has only src capabilities into CPU memory:

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw

not for video/x-raw(memory:NVMM).

You may use nvvidconv for copying from one space to the other one.

timeoverlay doesn’t accept NVMM memory, although it says ‘video/x-raw(ANY)’ for src capabilities.

@Honey_Patouceul is correct.

gst-launch-1.0 videotestsrc ! 'video/x-raw, width=(int)600, height=(int)600, format=(string)I420, framerate=(fraction)30/1' ! timeoverlay ! omxh264enc ! fakesink

Thank you for your answer! That actually solved it!