I used code from here. But there is one problem, I can´t change camera orientation. Final video is upside down.
I tried to change it by this (I tried all possible values - 0,90,180,270):
camera.setDisplayOrientation(90);
camera.getParameters().setRotation(90);
or
camera.getParameters().set("orientation", "portrait");
camera.getParameters().set("rotation", 90);
But nothing works. Any idea how to setup it? I tested it on Nexus 5X with Android 7.1.1. I want to use fixed orientation, no matter how I hold device, orientation must remain same.