# MPlayer command line usage



## Phishfry (Oct 30, 2017)

I am attempting to view some videos on the FreeBSD 11.1 command line.
Installed `multimedia/mplayer` and I am trying to use it like this:
`mplayer -vo dga drop.avi`

So what do I need to use DGA? Direct Graphics Access.
Should I use SDL ?

```
root@TV:~ # mplayer -vo 'sdl-dga' drop.avi
MPlayer SVN-r37946-snapshot-3.8.0 (C) 2000-2017 MPlayer Team

Playing drop.avi.
libavformat version 57.71.100 (external)
AVI file format detected.
[aviheader] Video stream found, -vid 0
AVI: No audio stream found -> no sound.
VIDEO:  [IV41]  256x240  24bpp  30.000 fps  882.5 kbps (107.7 kbyte/s)
Error opening/initializing the selected video_out (-vo) device.
No stream found.


Exiting... (End of file)
```




Can i view/use mplayer over an ssh connection? How about over a serial console.

Thanks


----------



## SirDice (Oct 30, 2017)

Phishfry said:


> Can I view/use mplayer over an ssh connection?


Maybe if you enable X forwarding. But it's going to be slow and the framerate is going to suck. 


Phishfry said:


> How about over a serial console.


I don't see how you're supposed to watch graphics output on a character based connection. Maybe if you enable the ASCII output


----------



## Phishfry (Oct 30, 2017)

Looking at freshports the option is turned on for a pkg:
X11DGA=on: X11 DGA video driver support

While SDL is not :
SDL=off: Simple Direct Media Layer support


----------



## Phishfry (Oct 30, 2017)

From the command prompt I get this:
vo: couldn't open the X11 display ()!


----------



## SirDice (Oct 30, 2017)

For X forwarding to work you will need to have an Xserver running on your client, and connect with ssh(1) which has -X turned on. The receiving sshd(8) also need to have X11forwarding enabled.


----------



## Phishfry (Oct 30, 2017)

My bad DGA is only for Xorg command prompt.

So it seems like this would work for MPlayer
"#5 SVGAlib: a low level console graphics layer"

Are there any command line video players not needing Xorg install?


----------



## SirDice (Oct 30, 2017)

SVGA lib should work but not over a character based connection like ssh(1) or serial. It should work when you actually sit at the console typing the commands.


----------



## Phishfry (Oct 30, 2017)

Yes I have access to the actual command prompt and I am using that.
In the future I may use a console only box. Just testing the capabilities to see what is feasible.

So i see this -mplayer package is built with SVGAlib off:

```
SVGALIB=off: SVGA graphics support
```
So i may build it from ports to check it out.


----------



## Deleted member 48958 (Oct 30, 2017)

The problem if you'll use X11 forwarding, is that sound will play on a server, while you'll see video output via mplayer.
But here is how it should work:
1. add "X11Forwarding yes" to /etc/ssh/sshd_config on a server.
2. restart sshd (on a server `# service sshd restart`).
3. connect to server via `ssh -Y name@X.X.X.X` (or `ssh -Y name@X.X.X.X mplayer video.avi`)
4. run `% mplayer video.avi`
5. watch muted movie 

Of course, if it will be a porno movie (or at least erotic  ), it will be not such a big issue if it will be with no sound


----------



## SirDice (Oct 30, 2017)

Forgot a step: 0. Run an Xserver on your client.


----------



## tobik@ (Oct 30, 2017)

ILUXA said:


> The problem if you'll use X11 forwarding, is that sound will play on a server, while you'll see video output via mplayer.
> But here is how it should work:
> 1. add "X11Forwarding yes" to /etc/ssh/sshd_config on a server.
> 2. restart sshd (on a server `# service sshd restart`).
> ...



Solution: Compile mplayer with SNDIO=on.

Then

Run an Xserver on your client.
 add "X11Forwarding yes" to /etc/ssh/sshd_config on a server.
 restart sshd (on a server).
 start sndiod on client: `sndiod -L localhost`
 connect to server via `ssh -R11025:localhost:11025 -Y name@X.X.X.X`
 run `env AUDIODEVICE=snd@localhost/0 mplayer -ao sndio video.avi`
 watch movie with full audio 
SCNR


----------



## Phishfry (Oct 30, 2017)

Thanks All 
I did my first X11Forwarding session without a hiccup.
Video was not smooth but not terrible considering a wifi client over ssh.

I need it simply to check if my TVTuner captures are successful. No quality needed.


----------

