[FFmpeg-user] Unable to initialize SDL, over X11 for only root

Jeff secjeff at gmail.com
Tue Apr 3 01:44:58 EEST 2018


Moritz & Cley,

Thanks for the responses! I believe I checked most of these points, but I will do so more methodically to ensure I didn’t miss anything.  

As far as why on the root user, I’m only speculating that’s how this application is working. I know its daemon runs as root, so I’m guessing that why it’s having issues calling ffplay. That said, a daemon calling it is different than me starting an interactive shell and calling it, so as you point out that may be where my issue is! I will dig into this more tomorrow and let you all know what I find.

Thanks again! I appreciate the great support you all provide.

Jeff

> On Apr 2, 2018, at 07:46, Moritz Barsnick <barsnick at gmx.net> wrote:
> 
> 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
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list