Poor encoding performance inside docker container on JP 4.4 with v4l2 encoder

Hi,

We’ve noticed a degradation in encoding performance running on a Jetpack 4.4 based system when we use the exact same gstreamer pipline inside vs outside a docker container. Here’s the gstreamer command we are using:

gst-launch-1.0 nvarguscamerasrc ! \
 'video/x-raw(memory:NVMM), width=(int)3840, height=(int)2160, \
 format=(string)NV12, framerate=(fraction)60/1' ! nvv4l2h264enc \
 maxperf-enable=1 bitrate=8000000 ! h264parse ! qtmux ! filesink \
 location=filename_h264.mp4 -e

See this video for a capture inside docker and notice the pixelation near the center of the image:

See this video for a capture outside docker on the same hardware, software, and same gstreamer command run outside the container: https://drive.google.com/file/d/1CcBeDBvUgRUktfVlPEU9LEE0_sxfJjDm/view?usp=sharing

We can reproduce this consistently, the video capture is always pixelated when obtained inside the docker container and looks better when obtained outside the container.

I’ve noticed a thread at Degraded H.264 encoding quality with docker and OpenMAX which suggests using v4l2 for encoding to resolve this, however we are noticing this problem with the v4l2 encoder.

Has anyone noticed this issue already and do you have any suggestions about how we could resolve?

Thanks
Dan

Hi,
Could you try

gst-launch-1.0 videotestsrc is-live=1 num-buffers=600 ! \
 video/x-raw,width=320,height=240,framerate=60/1 ! nvvidconv ! \
 'video/x-raw(memory:NVMM), width=(int)3840, height=(int)2160, \
 format=(string)NV12' ! nvv4l2h264enc \
 maxperf-enable=1 bitrate=8000000 ! h264parse ! qtmux ! filesink \
 location=filename_h264.mp4 -e

Would like to eliminate nvarguscamerasrc and check if the issue is still there.

@DaneLLL I can’t reproduce with videotestsrc although it’s a little hard to verify since it is a different video, but it appears to be something about nvarguscamerasrc, although I’d like to try to put together an example which uses the same video input in a gstreamer pipeline to ensure this is the case. Are you able to reproduce with nvarguscamerasrc? Or do you think this is something about the sensor hardware?

Hi,
It seems not related to docker. Might be because the bitrate value is too small. For 4Kp60, 8Mbps may not be sufficient. Could you try 30M~40Mbps? And also try 4Kp30.