Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify windows coordinates to cvlc #17

Closed
SvenVD opened this issue Aug 8, 2020 · 10 comments
Closed

How to specify windows coordinates to cvlc #17

SvenVD opened this issue Aug 8, 2020 · 10 comments

Comments

@SvenVD
Copy link

SvenVD commented Aug 8, 2020

omxplayer has the --win option that can be used like this:
--win "0 720 1920 1080"

rpisurv.net is heavily relying on this functionality, how can this be achieved with vlc or vlc python libraries?

Thanks

@jc-kynesim
Copy link

jc-kynesim commented Aug 10, 2020

--mmal-vout-window fullscreen|<width>x<height>+<x>+<y> will set the fullscreen output window position

@popcornmix
Copy link

I've done a few tests with latest apt vlc and it seems to be working. Making a note here, so I can refer back to what was tested.
Running from console (without x):
This displays video in a smaller window with framebuffer console hidden:

cvlc --mmal-vout-window 1280x720+64+128 <file>

This displays video in a smaller window with framebuffer console visible:

cvlc --mmal-vout-transparent --mmal-vout-window 1280x720+64+128 <file>

This displays video in a smaller window with framebuffer console visible and video behind framebuffer console:

cvlc  --mmal-layer -200 --mmal-vout-transparent  --mmal-vout-window 1280x720+64+128 <file>

This flips the video left-to-right. It also flips the dest coordinate (I'm not sure that is expected behaviour)

cvlc  --mmal-vout-transform hflip --mmal-vout-transparent  --mmal-vout-window 1280x720+64+128 <file>

This rotates video clockwise by 90'. It also transforms the dest coordinate (I'm not sure that is expected behaviour)

cvlc  --mmal-vout-transform 90 --mmal-vout-transparent  --mmal-vout-window 1280x720+64+128 <file>

@jc-kynesim
Copy link

Transform affecting win coords is expected as the "normal" use of it is to deal with rotated screens. I think VLC has a way of forcing source transform (i.e. overriding landscape/portrait encoded in the source) but I've forgotten how to do it (N.B. it isn't the transform module!)

@popcornmix
Copy link

omxplayer transforms source video and then renders to given dest coordinates, so the behaviour is different (although it's straightforward to adapt).
Also vlc is preserving aspect ratio. e.g. this doesn't render to a square - is there a way of forcing that? omxplayer does output square video here.

cvlc  --mmal-vout-transparent  --mmal-vout-window 1280x1280+64+128 <file>

@jc-kynesim
Copy link

I suspect there may be a zoom option that does that - not sure

@jc-kynesim
Copy link

You can force the source display aspect ratio with "--aspect-ratio a:b" so "--aspect-ratio 1:1" will give you a square pici. There is no explicit option for zoom to fill window but if you dup the window size into the aspect ratio you will get what you want.

@SvenVD
Copy link
Author

SvenVD commented Dec 30, 2020

Thanks for the help, I just release Rpisurv 3 Using cvlc player at its core, replacing omxplayer completely

@popcornmix
Copy link

Cool. Okay to close @SvenVD ?

@SvenVD
Copy link
Author

SvenVD commented Jan 1, 2021

Yes

@SvenVD SvenVD closed this as completed Jan 1, 2021
@KenT2
Copy link

KenT2 commented Jan 20, 2021

A few additional hints discovered by trial and error:
Using --crop or --aspect-ratio allows the --mmal-vout-window to work correctly provided the aspect ratio of the processed source matches that of the window
Using --crop and --aspect-ratio in the same command does not work. Use only one.
If using libvlc or python-libvlc the --crop and --aspect-ratio command options are ignored. They can be set using MediaPlayer methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants