Results 1 to 5 of 5

Thread: Launching mplayer through ssh

  1. #1
    Join Date
    Dec 2009
    Beans
    4

    Launching mplayer through ssh

    Hello,

    I got 1 pc and 1 laptop.
    i would like to launch mplayer on the pc with my laptop connecting in ssh. and control mplayer.

    Is it possible ?

  2. #2
    Join Date
    Sep 2006
    Beans
    8,623
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Launching mplayer through ssh

    Yes, you can:

    Code:
    ssh -X -l jney  pc
    mplayer /path/to/movie.mov
    or

    Code:
    ssh -X -l jney  pc  "mplayer /path/to/movie.mov"
    Last edited by Lars Noodén; December 7th, 2009 at 09:32 AM. Reason: -X

  3. #3
    Join Date
    Dec 2009
    Beans
    4

    Re: Launching mplayer through ssh

    hhmmm... actually i knew how worked ssh.

    what i want to do is to launch a movie with mplayer on remote pc and be able to watch it on that remote pc.

  4. #4
    Join Date
    Sep 2006
    Beans
    8,623
    Distro
    Ubuntu 14.04 Trusty Tahr

    export DISPLAY=:0.0

    Quote Originally Posted by jney View Post
    what i want to do is to launch a movie with mplayer on remote pc and be able to watch it on that remote pc.
    Ok. (BTW I fixed a typo above.)

    You'll want to know what display to target. Usually it is :0.0 and it is set in the environment variable "Display". 'export' passes the value available to programs launched from that shell. The part before the colon is where a machine name could go, but that's left blank to mean local host, which if you are logged into the remote host is the remote host.

    Code:
    $ ssh -l jney  pc
    export DISPLAY=:0.0
    mplayer /path/to/movie.mov
    There's not any good basic intro to X that I know of, but some info can be found in the Display Names section of the X manual. You can use the 'geometry' settings to place the new program in a particular area on the screen.

    Code:
    $ ssh -l jney  pc
    export DISPLAY=:0.0
    mplayer -geometry 400x300-1-1 /path/to/movie.mov
    If you are using a key to connect to the remote machine, then you can pass the value of DISPLAY with the key itself. The section on the authorized_keys file format in sshd goes into a bit of detail. The server will have to allow PermitUserEnvironment for that user's group.

  5. #5
    Join Date
    Dec 2009
    Beans
    4

    Re: Launching mplayer through ssh

    Thank you Lars ! "export DISPLAY=:0.0" is what i was looking for.

    i updated my zshrc to know if i'm connecting my terminal through ssh like it :

    <pre>
    if [ -n "$SSH_TTY" ]; then
    export DISPLAY=:0.0
    fi
    </pre>
    Last edited by jney; December 8th, 2009 at 10:14 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •