Camera.Parameters.setRecordingHint and aspect ratio

前端 未结 2 1453
粉色の甜心
粉色の甜心 2021-01-05 14:41

I\'ve found some odd behavior around Camera.Parameters.setRecordingHint that I\'d like to understand better.

If I set it to true, the size of the previe

相关标签:
2条回答
  • 2021-01-05 15:06

    You need to set video-size parameter to the correct value. I had the same problem - preview size was 640x480 and the preview appeared stretched while using setRecordingHint(true). I then used getParameters().flatten() to print out all parameters set for my Camera device. My video-size parameter was actually set to 1920x1080 causing the incorrect aspect ratio. You can change this parameter using params.set("video-size", "WxH"). Only then is the aspect ratio correct.

    0 讨论(0)
  • 2021-01-05 15:14

    i've seen a lot of random behavior around this and it unfortunately depends on the oem as well. i see a difference in framerate as well on some phones, like nexus 4 preview framerate drops in half. we depend on the preview frame callback to come at our desired framerate so we have to switch it on phone model unfortunately.

    0 讨论(0)
提交回复
热议问题