Play video from VLC in X11 from a remote terminal

I have a problem, I hope you can help me. I have thin terminals with Linux where a little script runs every time it boots. This script has one cvlc command line that looks like this:

cvlc --quiet --fullscreen --no-osd --loop playlist.xspf 

This works fine because the terminals start the X11 environment and then the script starts from autorun; the video that it played and got beautifully on the LCD. My problem arises when for one reason or another I need to remotely kill the cvlc process and start it again. I am an ssh terminal with the same user registered in the X11 environment, I run the line of code described above and play the video, yes ... but on the terminal I logged in!

Thus, the video is played in character-only mode, it displays as text in my console; Of course, nothing is visible in the X11 environment. So my question is: How can I run my cvlc command And play the video in X11 NOT in the console itself ???

If I just try to play it without parameters, I get the following output:

 $ cvlc playlist.xspf VLC media player 1.1.4 The Luggage (revision exported) Blocked: call to unsetenv("DBUS_ACTIVATION_ADDRESS") Blocked: call to unsetenv("DBUS_ACTIVATION_BUS_TYPE") [0x9cb1114] inhibit interface error: Failed to connect to the D-Bus session daemon: /bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed. [0x9cb1114] main interface error: no suitable interface module [0x9cb0754] main interface error: no suitable interface module [0x9c17914] main libvlc error: interface "globalhotkeys,none" initialization failed [0x9caeca4] dummy interface: using the dummy interface module... [0x9cabfa4] main playlist: stopping playback [0x9dedb34] xcb_xv generic error: parent window not available [0x9dedb34] xcb_x11 generic error: parent window not available [0x9dedb34] xcb_glx generic error: parent window not available [0x9dedb34] fb generic error: cannot get terminal mode (Invalid argument) Blocked: call to signal(28, 0x60ae4e0) Blocked: call to setlocale(6, "") Blocked: call to sigaction(20, 0x46935e0, (nil)) Blocked: call to sigaction(2, 0xb730c948, (nil)) Blocked: call to sigaction(15, 0xb730c948, (nil)) Blocked: call to sigaction(28, 0xb730c948, (nil)) ^C[0x9cae2b4] signals interface error: Caught Interrupt signal, exiting... umboard@MB124205 :~$ 

So the problem is that I do not have direct access to X11 from my remote terminal, so how can I play video from a remote console using cvlc or vlc?

Please help me, THANKS MUCH !!!

+6
source share
2 answers

The $ DISPLAY environment variable contains the value of the X server instance where graphical applications can be run. Therefore, this value is necessary:

 echo $DISPLAY :0 

Then this value should be used with the cVLC --x11-display option, as in:

 cvlc --x11-display :0 video.mp4 

In this way, the video will be output to the X Server session, even if this command is used in a remote ssh session. However, if the session ends, the video will stop, so you need to complete the background task, so when you log out, the video continues to play:

 cvlc --x11-display :0 video.mp4 & 

As a reference to my exact needs, which you might find useful if you need to run the video in a remote terminal and you need to loop it, without a visible VLC interface, in full screen mode and without absolute output to the console, because if you run the command, as in the previous example, maybe the VLC output will be transferred to another SSH session with the same user, you need to run it as follows:

 cvlc -q --no-osd -L -f --no-video-title-show --x11-display :1 video.mp4 2&>1 >/dev/null & 

Standard output and error will not be displayed in the session in this way.

+7
source

You need to set the DISPLAY variable.

For instance:

 export DISPLAY=:0 

You may need to use set instead of export (and / or change: 0 to something like that, I can’t check google for the DISPLAY variable at the moment), but it’s a general idea to tell what output you want the window to display.

UPDATE . As can be seen from the comments below, the OP detected a command line option:

 --x11-display :0 
+7
source

Source: https://habr.com/ru/post/910353/


All Articles