SDL2 over x11: "SDL: could not set video mode - exiting"


I’m sorry if this is covered somewhere else, but I can’t seem to find a solution on this forum or through google searches anywhere. This seems to be somewhat common, but again, no definitive solution.

When I try to run a SDL2 application (e.g., ffplay) over X11 via SSH and Exceed, I receive the following error: “SDL: could not set video mode - exiting”.

This only occurs with SDL2 applications (I’ve tried glxgears as well). Non-SDL, X-Windows applications work fine over the connection (e.g., terminal, xclock, etc). I’m able to launch ffplay locally on the machine itself, so it just fails over SSH forwarding.

The DISPLAY variable is set properly (and works for other apps as mentioned).

I’ve tried setting the SDL_VIDEODRIVER to x11 as well, but still no luck. Is there something I’m missing? I have all the X11 (and DEVEL) libraries installed. SDL2 was configured with the standard ./configure options and shows X11 support in the config file.

Please advise. Thank you.

Maybe SDL is trying to use OpenGL which AFAIK doesn’t work with SSH forwarding (maybe can help?).
SDL will use OpenGL at least for 2D accelerated rendering ( and of course if the application uses OpenGL directly (which ffplay at least supports, not sure if it’s default).
Maybe it could work with accelerated 2D rendering (
No idea how exactly ffplay uses SDL and the error message is not from SDL_GetError() (which may have more specific information on why it failed) but it’s apparently from ffplay (probably after some SDL function call has failed).

Have you tried asking the ffplay developers?

Thank you for the information. As you suggested, I’ve also sent the question into the ffmpeg folks. I do believe SDL2 defaults to using X11 (but I’m not familiar with the OpenGL tie in). Happy to explore and verify any logging information if you have suggestions about where to dig in.

Thanks again,