In low-latency mode, the frame is divided into multiple slices. The encoder output and decoder input will operate at slice level. Encoder input and decoder output still operate on frames. When a slice is done an interrupt is generated and the encoded output is made available. This restricts the number of streams that can be encoded to 2 and decoded to 1 (one per core).
For encoding, set control-rate to
low-latency for best performance and pass alignment=nal through the caps at the encoder source
pad.
gst-launch-1.0 v4l2src io-mode=4 device=/dev/video0 ! video/x-raw, width=1920, height=1080, framerate=60/1, format=NV12 ! omxh264enc gop-mode=low-delay-p, b-frames=0 control-rate=low-latency ! video/x-h264, alignment=nal ! fakesink
For decoding, set low-latency=1 and set
alignment=nal in the caps.
gst-launch-1.0 filesrc location=in.mp4 ! qtdemux name=demux demux.video_0 ! h264parse! video/x-h264, alignment=nal ! omxh264dec low-latency=1 ! queue max-size-bytes=0 ! fakevideosink
Command line argument --slicelat
specifies low-latency for encoder,
ctrlsw_encoder –cfg encode_simple.cfg --slicelat
and decoder,
ctrlsw_decoder -avc -in in.h264 -out out.yuv --slicelat