MPlayer over SSH to Play Movie from Remote Host

MPlayer is a great movie player. SSH is a great tool to connect and transfer data over the network securely. Combining these 2 great tools together will be greater. You may already has a small server storing some movies or videos or music and playing them on your laptop will be convenient. In this post, we will introduce three methods to play movie using MPlayer over SSH.

Here, we use the example that we want to play the movie file ~/movie.mp4 on user@example.org.

X11 forwarding

Use the -X option of the ssh client, we can enable X11 forwarding. (Read: ssh manual)

ssh -X user@example.org mplayer ~/movie.mp4

The command is straightforward and you can also just connect to the remove server and invoke mplayer anytime you like. The drawback here is that there is no sound.

Use ssh as a data transfer tunnel

MPlayer can play content from STDIN. We can use ssh to transfer the movie file

ssh user@example.org cat ~/movie.mp4 | mplayer -

This is also handy. The drawback is that you can not seek back when you play the movie.

Mount remote directory over ssh

This method is my favorite one.

We can mount a remote directory over ssh to our laptop (e.g. ~/remote) by:

sshfs user@example.org: ~/remote

Read more on mount remote folder by ssh at Mounting Remote Folder Through SSH.

Then you can just use MPlayer open the movie under ~/remote by:

mplayer ~/remote/movie.mp4

Eric Zhiqiang Ma

Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *