Cameraview: Force recorded video rotation

Created on 5 Feb 2019  路  13Comments  路  Source: natario1/CameraView

How do I?

Hi, is it possible to force the CameraView to record video in specific orientation, like Landscape for example?
I have my activity locked to landscape, but if the user continue to keep the device in portrait position, no matter that the content view is in landscape mode the recorded video is still in portrait.
It seems like the CameraView uses the device's sensor.
Thanks in advance!

Version used

com.otaliastudios:cameraview:1.6.1

enhancement

All 13 comments

No, it's not possible, sorry. We use the device's sensor.

@natario1
I need this feature for photos too. I copied library source code and changed OrientationHelper as a temporary solution. Is it possible to have some extension point here?

Hey @aartikov , a PR would be appreciated!

There should be an API + xml attribute to enable and disable this behavior. Something like setUseDeviceOrientation and app:cameraUseDeviceOrientation?

This issue has been automatically marked as stale because it has not had activity in the last 20 days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

OrientationHelper

I want my recorded video to be always in portraint mode (zero rotation), doesn't matter how user rotates video. Could you please guide me where did you make change for that. Does making change only in orientation helper is enough?

I too want to disable the automatic rotation applied on video output. @aartikov Can you share with us OrientationHelper changes? Thanks!

Currently I use this lib for user capture their ID card.
They often put it in table and capture.
Some time this lib is mixing between Portrait and Landscape mode.
So this function should be provide soon.

Same for me here , I'm stuck on a problem where when I'm recording the CameraView appears in landscape but everything else on my app is in portrait mode

@PalakSDarji
Sure. I have pushed my changes in this commit https://github.com/aartikov/CameraView/commit/a71c0f228c8136f929e044bc451cbc7b6334d401
I have added method setAllowedOrientation to CameraView with possible values: LANDSCAPE, PORTRAIT, ANY. You can check out how it works in the demo app.

@natario1
I don't make a PR with my solution because I am not sure that it will fit needs of everybody. What do you think about it? As I can see you already have a PR that addresses the issue. Sorry that I am too later with my comment.

Hello,

@natario1
Thanks , when do you think it will be implemented on your projet and on which version please ?
I'm still using the 1.6.1 version actually :/

Hey, you can use setUseDeviceOrientation now (to be released in next version).

@ManuEpi time to migrate! :-) will go out of beta soon.

Hey , I will migrate soon ! :)
Thank you

@natario1 will this be available in a future release? I currently need this same feature.

Was this page helpful?
0 / 5 - 0 ratings