openvinotoolkit / openvinotoolkit/docker_ci

Can these images be used with the `gstreamer` `vaapi` plugin in a non-interactive shell?

Open
#99 2 comments 0 reactions 2 assignees View on GitHub

@generalova-kate is already working on this.

Since Apr 30, 2021.

enhancement
Dominant language
Python
Stars
70
Forks
65
Avg merge
16h 59m
Merged PRs (30d)
3

Description

Maybe I'm missing something obvious, but if I try to use this image without first initializing an interactive bash session, I cannot use the vaapi plugins. Compare the output of the following, executed on an Ubuntu 18 host:

Creating a container based on the data_dev image and directly running gst-inspect-1.0:

docker run -it --rm --device '/dev/dri:/dev/dri' \
        openvino/ubuntu20_data_dev:latest \
        gst-inspect-1.0 vaapih264enc
error: XDG_RUNTIME_DIR not set in the environment.
No such element or plugin 'vaapih264enc'

Doing the same, but running the command within the context of an "interactive" bash shell:

docker run -it --rm --device '/dev/dri:/dev/dri' \
        openvino/ubuntu20_data_dev:latest \
        /bin/bash -i -c "gst-inspect-1.0 vaapih264enc"
error: XDG_RUNTIME_DIR not set in the environment.
[setupvars.sh] OpenVINO environment initialized
Factory Details:
  Rank                     primary (256)
  Long-name                VA-API H264 encoder
  Klass                    Codec/Encoder/Video/Hardware
  Description              A VA-API based H264 video encoder
  Author                   Wind Yuan <feng.yuan@intel.com>
  
# <etc...>

As I understand it, using the -i flag when starting bash has many effects, including reading startup files. I can see in the output that [setupupvars.sh] runs in the interactive session. However, there seems to be something more going on. I tried creating a new derived image with an ENTRYPOINT script that sources /opt/intel/openvino/setupvars.sh (and/or .bashrc or .profile files), then execing the original command, but that is not sufficient to make the vaapi plugin available (and this may just be my misunderstanding about how bash's environment propagates -- suggestions are welcome).

Obviously, the command above (using /bin/bash -i -c) works around this issue, but it is not ideal. Is there a way to run a gstreamer command that uses the vaapi plugin within a container based on this image without using an interactive bash session?

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.