Nveglstreamsrc -> omxh264enc issue

Hi,
I am trying to use nveglstreamsrc with omxh264enc to encode the output of my opengl application. I followed the procedure given in the following links.
https://github.com/DaneLLL/simpleEGLStreams_producer
https://github.com/DaneLLL/gstreamer_eglstreamsrc

I was able to connect nveglstreamsrc to nvoverlaysink and it worked fine.
But when I use omxh264enc with nveglstreamsrc, I face the following issue.

Using launch string: nveglstreamsrc name=egl_src ! video/x-raw(memory:NVMM), format=I420, width=1280, height=720, framerate=30/1 ! omxh264enc bitrate=2500000 name=video_enc iframeinterval=15 profile=high control-rate=4 ! queue ! video/x-h264, stream-format=byte-stream ! fakesink

NVEGLStreamProducer: start_eglstream_producer ++
eglDisplay Handle created
EGLStream initialized
NVEGLStreamProducer: start_eglstream_producer –
display 0x645100, stream 0x6686a1
Thread created
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
Obtained EGLConfig and EGLContext
Bound layer to rendering surface
eglSwapBuffers_wrapper—: 1
NvMSEncCheckInputSurface:327: Only Blocklinear and Pitch surface format allowed
VENC: VideoEncInputProcessing: 4376: VideoEncFeedImage failed. Input buffer 0 sent
VENC: NvMMLiteVideoEncDoWork: 5001: BlockSide error 0x4
Event_BlockError from 0BlockAvcEnc : Error code - 4
Sending error event from 0BlockAvcEnc0:00:00.669944218 3124 0x7f90001950 ERROR

I am using Tx2 with L4T28.2.1.

Can you anyone help me out?

Hi,
Please add nvvidconv and try again.

nveglstreamsrc name=egl_src ! video/x-raw(memory:NVMM), format=I420, width=1280, height=720, framerate=30/1 ! nvvidconv ! video/x-raw(memory:NVMM),format=NV12 ! omxh264enc ! ...

Hi DaneLLL,
Thanks for your quick response.
I tried with nvvidconv as suggested and I am still facing the same problem.

Hi,
Please try the solution:

Hi DaneLLL,

Thanks a lot for your inputs. I replaced the libgstnveglstreamsrc.so provided by you and used the launch_stream pipeline provided. Now i am able to use the encoder. It will be of great help if you can let me know if you an example for using the nvtee. I am able to get data only using the pre_src pad and not vid_src pad.

Thanks in Advance.

Hi,
You may use tee plugin. Please refer to

The pipeline would be like

nveglstreamsrc name=egl_src ! video/x-raw(memory:NVMM), format=RGBA, width=1280, height=720, framerate=30/1 ! nvvidconv ! video/x-raw(memory:NVMM),format=NV12 ! tee name=t t. ! queue ! nvverlaysink t. queue ! omxh264enc ! ...