开发者

How to force camera to send video in landscape?

I would like to know if it's possible to force the camera to send video in landscape mode (width > height)

Let's say that we have a little app for android which send the image captured from the camera using SIP. What is happening is that the size of the video depends on how you have your mobile. If you have your mobile vertially the camera captures a portrait_size video, and if you have your mobile horizontally the camera caputres a landscape_size video. I guess this is because of the Camera.Preferences, it makes the size of the surface based on the camera real sizes.

What I want is to have the mobile in portrait mode, but I want to show the video in landscape format, of course it will be resized to fit in the screen as your screen is on portrait mode. Is there any way to do that?

I think of some possibilities and maybe to force the camera to record in landscape mode, even if the phone is in portr开发者_如何学Cait mode. I don't know if this is possible.

I think of making a bridge which resizes the video and show it like a landscape video it was. This option should be more complicated.

I don't know for sure a lof of code that you have to make, just if anyone has a reference link or some code that resizes video in the way I am looking for, or the Classes that I have to use to do it. I really have been looking for information and didn't really find anything that helps me. Any help is really appreciated.


You would have to capture the video in landscape in the first instance to make life easier.

I noticed that there is a simple way to do this if you are initiating your video recording via a MediaStore intent.

This is detailed in the EXTRA_SCREEN_ORIENTATION documention.

If you are doing this manually using the Camera API then there will be an equivalent.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜