P4d0uch
Posts: 47
Joined: Sun Sep 16, 2012 5:01 pm

OMXPlayer video rotation

Tue Dec 27, 2016 5:35 pm

Hello,
Is there any way to rotate video in OMXplayer? Im using the official 7inch screen in portrait mode (see the picture) Image , but I wanted to play in landscape mode. Adding the

Code: Select all

--orientation 90
does rotate the video, but not in a way i have imagined :) (second picture) Image

Thank you for your help.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8918
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: OMXPlayer video rotation

Tue Dec 27, 2016 6:27 pm

That's going to be the fault of the omxplayerGUI that you're wrapping omxplayer with.
It will have specified an x and y offset, and width and height that the image is to be rendered in to, and it's not modified that area based on the rotation. The GPU therefore does what it is told and renders the image into the defined area, but it has to stretch it to do so.
Without tracking down the source to the GUI you won't be able to resolve the issue, but it is just a couple of parameters to the display region that is wrong. omxplayer from the command line may do the correct thing for you by default.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

gkreidl
Posts: 6326
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: OMXPlayer video rotation

Tue Dec 27, 2016 6:47 pm

6by9 wrote:That's going to be the fault of the omxplayerGUI that you're wrapping omxplayer with.
It will have specified an x and y offset, and width and height that the image is to be rendered in to, and it's not modified that area based on the rotation. The GPU therefore does what it is told and renders the image into the defined area, but it has to stretch it to do so.
Without tracking down the source to the GUI you won't be able to resolve the issue, but it is just a couple of parameters to the display region that is wrong. omxplayer from the command line may do the correct thing for you by default.
Yes, omxplayerGUI takes it coordinates from desktop and that won't change. But is also supports a mode without a GUI and if you use that (create a matching preset) you could run the rotated video (full screen only). Start with the nogui preset and add "--orientation n" option.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

P4d0uch
Posts: 47
Joined: Sun Sep 16, 2012 5:01 pm

Re: OMXPlayer video rotation

Tue Dec 27, 2016 10:04 pm

Thank you so much. It works great. Just added

Code: Select all

--orientation 90
--aspect-mode stretch
Image. And lower resolution video:
Image

Is there any way to get at least play/pause and/or stop button? If not I will have to add another button to the back of the case and get at least some playback control using GPIO pins, because I´m trying to get the Pi working without keyboard and mouse.

gkreidl
Posts: 6326
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: OMXPlayer video rotation

Wed Dec 28, 2016 6:10 am

In full screen mode only keyboard controls are available.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Return to “Graphics, sound and multimedia”