Currently I capture video from GMSL2 camera, do h264 encoding and streaming through TCP/IP on Xavier as client. Then on the Windows server side, I split stream into 5 minutes segmentation. For some reason, the video segmentation length need to be exact 5 minutes long and does not need to be starting with I frame or ending with a full cluster (I:P=1:29 in my case).
My C code is similar to these two pipelines:
For sender (Xavier):
gst-launch-1.0 videotestsrc do-timestamp=true ! “video/x-raw,width=(int)1920,height=(int)1080,framerate=30/1,format=(string)I420” ! omxh264enc profile=2 insert-sps-pps=true iframeinterval=30 ! h264parse ! matroskamux ! queue ! tcpclientsink host=192.168.1.2 port=5000
For receiver (Windows):
gst-launch-1.0 tcpserversrc host=192.168.1.2 port=5000 ! matroskademux ! h264parse ! queue ! splitmuxsink location=test%02d.mkv send-keyframe-requests=true max-size-time=300000000000 muxer=matroskamux
Since for splitmuxsink, it will find the closest keyframe and split at that location, which may cause the segment less than 5 minutes instead of exact 5 minutes. As I mentioned before, I do not need the MKV segments to start with keyframe or end with a full cluster (I:P=1:29). Hence I am using “send-keyframe-requests=true” to force a keyframe from omxh264enc.
I have managed to achieve this with Xaiver only (discard TCP/IP streaming and save video segmentation directly on Xavier). However I cannot force keyframe with TCP/IP streaming.
My question is how to send-keyframe-requests to Xaiver omxh264enc through TCP/IP from Windows. Or is there any other brilliant way to achieve what I want for exact time MKV video segmentation?