Gstreamer freeze (like slow motion video) after awhile (URGENT)

Hi,
It sounds like the process in appsink is too slow and then the whole pipeline gets slowed down. You may try to return the GstBuffer directly and check if the issue still happens.

We have deprecated omx plugins. Please try nvv4l2h264enc

And you should not need to encode and re-decode, convert to BGR data. This command should be better:

v4l2src device=/dev/video8 io-mode=mmap ! video/x-raw, format=I420, width=1920, height=1080, framerate=25/1 ! tee name=t ! queue ! nvvidconv ! nvv4l2h264enc bitrate=5000000 ! h264parse ! matroskamux ! filesink location=output.mkv t. ! queue ! videoconvert ! video/x-raw, format=(string)BGR ! appsink emit-signals=true sync=false max-buffers=10 drop=true

May apply your string to this sample for a try:
Gstreamer decode live video stream with the delay difference between gst-launch-1.0 command and appsink callback - #6 by DaneLLL