4

I'm trying to use omxplayer to play a movie file having the movie display placed a certain position and with a custom size.

I was hoping this parameter would work

--win "x1 y1 x2 y2" Set position of video window

Whenever I try to open a file like this the position and dimensions are never changed.

omxplayer --win "50 50 50 50" vid.mp4

This should position the video display at 50 pixels from top left and bottom right corners of the screen. However it does not.

Is there something wrong with my parameters?

Fábio Antunes
  • 149
  • 2
  • 4
  • 14

3 Answers3

4

On my 1024x768 setup it looks like this :

"--win \"784 588 1024 748\"

      a   b    c   d

a) how far to the right is the top-left corner of the window (1024-240)

b) how far down is the top-left corner of the window (768-180)

c) where the window should end (width)

d) where the window should end (height)

My window is 20px above the edge of the screen to keep my panel visible.

As a result you get a 240x180 window placed at the bottom right corner right above the panel.

LotF Rpi

EDIT : I used backslashes to use omxplayer in twitch streaming script

livestreamer twitch.tv/$1 $2 --player omxplayer --fifo --player-args "--win \"784 588 1024 748\" {filename}"

They shouldn't be necessary in normal usage.

James
  • 56
  • 2
1

If I'm right, setting all values to '50' will create a frame of 0 pixels, considering all coordinates start from the top left corner. Try something like:

--win "0 0 640 480"

If you want a 50px margin starting from each border you will need to take the width and height of your screen and subtract by 50. On a 1440 x 1080 screen this would be:

--win "50 50 1390 1030"

Dweez
  • 11
  • 3
0

I installed VLC media player on my Pi, and was disappointed for overheating just after 5-6 second playing the selected video. Than I red about the omxplayer. I gave a try and my first experience was nice from commandline:

omxplayer -o local --win "-40 -40 640 380" my_video.mp4

 # where [ -o local] -plays the analog audio
 # where [ --win .. -sets the video
 # -40 -40 means a negative coordinate out of my screen because I do not need the frame of the tutorial video
 # 640-width and 380-height of the video.

AND my Processor did not overheat, To find out more about omxplayer tpye in the commandline:

man omxplayer 
stefansson
  • 141
  • 3