2

I am using the Repository version of the command line player MPlayer under Xenial Xerus LTS. When I open a video I would like to control the following:

  1. The size of the MPlayer window
  2. The position in the screen that the MPlayer window opens up in (i.e. centre, left, right. top etc)

How do I do this from the command line?

6

Two different sets of options that can be combined for ultimate output control:

1. Window Size:

The easiest way to set a size for the MPlayer window is to use the -xy option. If the value of this option is greater than 8 the width of the video window is set to that value. The height is then calculated from this width to maintain the correct aspect ratio.

To have a window 800 wide you would use the following:

mplayer -xy 800 test.mp4

2. Screen Position:

This can be set using the MPlayer -geometry option utilising either:

  1. x and y coordinates:

    50:40 Places the window at x=50, y=40
    
  2. Percentage values:

    50%:50% Places the window in the middle of the screen
    

To run a video in the middle of the screen try the following:

mplayer -geometry 50%:50% test.mp4

3. All together now...

Finally, to run the movie in the center of the screen, using a window width of 800, use the following:

mplayer -xy 800 -geometry 50%:50% test.mp4

How cool is the command line :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.