I am running an accelerated GStreamer pipeline inside a docker container on a TX2. Even though everything seems to be working (no errors, video is streaming), the video quality is significantly poorer than when I run the same pipeline outside of the docker environment.
My real pipeline takes an RTSP stream, transcodes it, and distributes it via UDP.
I can reproduce the problem with this simple example pipeline:
When running the above on the host, a video file of ~34MB is produced. Running it inside a docker container results in a file of ~1.9MB. The video from inside the container is visibly much more compressed.
When running the gstreamer pipeline in verbose mode, the caps information printed is identical inside and outside.
TX2 with Ubuntu 18.04 with the nvidia container runtime installed
Based on nvcr.io/nvidia/l4t-base:r32.5.0, with gstreamer installed via apt
Running with the nvidia runtime,
with the environment variables "NVIDIA_VISIBLE_DEVICES=all", "NVIDIA_DRIVER_CAPABILITIES=all"
How can I get the gstreamer pipeline in the container to perform the same as on the host?
Thank you for your suggestion.
How could those two changes explain why I’m seeing different results inside and outside of docker?
I tried the pipeline you provided. It produces video files of ~2MB both inside and outside the container. Even though the size is about that of the low-quality video I got inside the container before, the video quality looks quite good.
However, with my real pipeline, this does not work well. I get very few frames, maybe one very 5 s.
The real pipeline now looks like this:
As you can see I am receiving H265 encoded video (1080p, ~2Mbit/s), transcoding it to H264 and then recording it to file and redistributing to a couple of clients. I also switched the decoder from omxh265dec to nvv4l2decoder.
This used to work fine outside of docker with omx.
Before inserting video/x-h265, framerate=\(fraction\)25/1 after rtph265depay, I was seeing framerate=0/1 in some caps, so I thought I had the issue discussed here:
But after adding the framerate caps, I no longer see any 0 framerates, but the issue persists.
No, with nvv4l2h264enc, I don’t have this issue. The quality and the framerate is fine.
But the root issue is unresolved for me. It’s great that with the switch to nvv4l2h264enc, I no longer see different behavior inside and outside the container, but I don’t understand why this difference was there to begin with and why it’s not there now.
We have deprecated omx plugins on Jetpack 4.x releases. The plugins are in the release but not maintained, so it’s possible it doesn’t work in some use-cases. We will remove the plugins in future Jetpack release.
Please use v4l2 plugins in implementing your use-case.