Gstreamer does not work with other user than mendel

746 Views Asked by At

I have a google coral dev board. I want the gstreamer plugin to work with user other than default user mendel .I performed the following steps and ran into problem.

  1. Installed the gstreamer using the following command.
    sudo apt-get install -y gstreamer1.0-plugins-bad gstreamer1.0-plugins-good python3-gst-1.0 python3-gi

  2. Then cloned the mendel user in the following script.

SRC=$1
DEST=$2

SRC_GROUPS=$(id -Gn ${SRC} | sed "s/${SRC} //g" | sed "s/ ${SRC}//g" | sed "s/ /,/g")
SRC_SHELL=$(awk -F : -v name=${SRC} '(name == $1) { print $7 }' /etc/passwd)

useradd --groups ${SRC_GROUPS} --shell ${SRC_SHELL} --create-home ${DEST}
passwd ${DEST}


3. If we save the above file under the name clone-user.sh. Then use the following command
./clone-user.sh mendel user2.

  1. If we switch to the user created above using sudo su - user2 and run the command the gst-launch-1.0 videotestsrc ! waylandsink. Then gstreamer wont work.

  2. Where as the command gst-launch-1.0 videotestsrc ! waylandsink works if we are using a default user. In my case it is mendel.

I have tried the link. But it also doesnot work.

1

There are 1 best solutions below

1
Nam Vu On

You can get the new user's id with:

$ echo $UID

copy the files from /run/user/1000 to the new user's id:

$ cp -r /run/user/1000 /run/user/$UID

own it:

$ sudo chown username:username -R /run/user/$UID/*

set XDG_RUNTIME_DIR:

$ export XDG_RUNTIME_DIR=/run/user/1000

I'm able to do this and run the edgetpu_classify and gst-launch-1.0 with both mendel and root.