[FFmpeg-user] Unable to initialize SDL, over X11 for only root
Moritz Barsnick
barsnick at gmx.net
Mon Apr 2 14:46:31 EEST 2018
Hi Jeff,
On Sun, Apr 01, 2018 at 16:28:28 -0400, Jeff wrote:
> However when running *ffplay* as the root user over X11 on the same files,
> I am getting met with the '*Unable to initialize SDL*' error.
First of all: *WHY*?? There is usually no good reason to run anything
as root, if you are not administrating the system. If the user and
ffplay need access to some files or devices, grant the user access,
instead of using root.
> I came across this (
> http://www.ffmpeg-archive.org/help-ffplay-Could-not-initialize-SDL-td4675063.html)
> thread/post form Moritz indicating there may be an issue using ffplay as
> root?
The user never gave indication as to what he was doing, so we can't
know. My questions in the last e-mail are still valid.
> In this particular case, there is a program daemon which is run as root
> that calls ffplay. This is why the call is being made by the root user.
A daemon that has access to a display? In that case, ffplay should be
called as something like "su <displayuser> -c 'ffplay'".
> It seems something is different in the case of root over X11 vs. a direct
> terminal call from the root user's desktop, but I don't have the foggiest
> idea.
I don't see a specific ffmpeg / ffplay issue. See Cley's answer: No X11
program may work at all. It has always been that way, at least for the
last 20 years or so. X11 uses "cookie authentication". To allow root to
use the user's cookies, you can either:
- open up access to the display using "xhost +local" (giving up all
security),
- migrate the auth cookie to the root process,
- use sudo from the user account to root (I think),
- log into root's account with "ssh -X" (which will automatically
migrate the cookie and give access via an SSH tunnel).
The latter two require interactive use, I guess.
Extra issue: If your display uses Xwayland, some of the above no longer
work. See also e.g. here:
https://bugzilla.redhat.com/show_bug.cgi?id=1266771#c4
Cheers,
Moritz
More information about the ffmpeg-user
mailing list