================================= Problem description ========================== =
In the latest project, the camera is installed at 90 degrees with the mobile phone, and the video is recorded at mediarecorder or in the direction of the camera instead of the mobile phone. The video is rotated at 90 degrees, I tried many methods and did not use them. Mediarecorder. setorientationhint has no effect and is not implemented in the underlying authordriver; camera. parameters. setrotation and then camera. setparameters and mediarecorder. setcamera does not work either. Do you know the solution? The code is roughly as follows:
Camera mcameradevice = camera. Open (camera_id );
Camera. Parameters mparameters = mcameradevice. getparameters ();
Mparameters. setrotation (90 );
Mcameradevice. setparameters (mparameters );
Mediarecorder mmediarecorder = new mediarecorder ();
Mmediarecorder. setcamera (mcameradevice );
Mmediarecorder. setorientationhint (90 );
......
Mmediarecorder. Prepare ();
=============================== Solution 1 ========================== ===
In the camera driver layer, you rotate the captured data buffer according to the orientation of gsensor.
How can I rotate a mediarecorder video?