0

Im using camera plugin to capture images, but it produces images in landscape orientation even though I keep the phone in portrait orientation.

I tried rotating the images after capturing using a different package, but that was very inefficient as the process takes too long to complete.

Can someone tell why is it happening and is there any solution.

How I initialize the controller

 controller = CameraController(
  widget.cameras[1],
  ResolutionPreset.medium,
  imageFormatGroup: ImageFormatGroup.jpeg,
);

and I listen to the controllers imageStream.

Device: Mi Poco F1 | Android version: 10

I need to capture a minimum of 10 frames per second and push it to a web socket continuously for 30 seconds.

So, even though the solutions in the first 2 comments actually work, they are inefficient for my requirement as they cause the UI to freeze.

Ashique
  • 25
  • 2
  • 5
  • 1
    I suspect this is a duplicate and the answer here is what you are looking for: https://stackoverflow.com/a/60735956/85472 – Maks Mar 01 '22 at 00:51
  • 1
    Does this answer your question? [How to fix wrong rotation of photo from camera in flutter?](https://stackoverflow.com/questions/60176001/how-to-fix-wrong-rotation-of-photo-from-camera-in-flutter) – Maks Mar 01 '22 at 00:52
  • Thanks for your comments. The solutions in these answers actually work but they take too much processing time for my requirements and cause the UI to freeze. – Ashique Mar 01 '22 at 15:14
  • 1
    UI "freezing" is likely because you need to do any kind of heavy CPU processing off the main thread, which in Flutter means in a separate Isolate, but that is a completely **different** issue, so please ask that in a new question or better please do a search on SO first as that a common question that is likely also to have already been answered. – Maks Mar 01 '22 at 23:11

0 Answers0