GStreamer pipeline inside docker conatiner produces low quality video

Hi,
Please set is-live=1 to videotestsrc plugin and use nvv4l2h264enc instead of omxh264enc to run like:

gst-launch-1.0 -v -e videotestsrc is-live=1 \
    ! video/x-raw, format=\(string\)NV12, framerate=\(fraction\)25/1 \
    ! nvvidconv \
    ! nvv4l2h264enc \
    ! h264parse \
    ! matroskamux \
    ! filesink location=`date +%Y-%m-%d-%H-%M-%S`.mkv &\

And may also try CBR mode and set virtual buffer size. Please refer to
Random blockiness in the picture RTSP server-client -Jetson TX2 - #5 by DaneLLL