I’ve just updated open vidu and I’m happy to see it now records direct to mp4 which has solved a lot of headache, however a new issue has come up.
I don’t specify any resolution in js when creating the stream which seems to let open vidu determine the camera orientation and size, it’s always been ok like this. But after the vidu server update the recordings are always in landscape and the portrait from mobile phone is chopped off at the top and bottom.
I did try to test putting a portrait resolution when creating the stream from js but the recording is still chopped in landscape mode.
Just wondering what has changed in the latest version? Is there a setting I have to send to the api call when generating the stream? So use js to detect the width and height and send those to the server to create the correct dimensions?
I am using a curl api call to my vidu server to create the stream.
On the front end, i am checking if the available device height is greater than the width, and then swiching the resolution around like this:
// init landscape
let resolution = ‘1280x720’;
if(screen.availHeight > screen.availWidth){
// portrait mode
resolution = ‘720x1280’;
}
OVPublisher = OV.initPublisher("publisher-video",{
videoSource:true,//OVFrontCamID ? OVFrontCamID : OVBackCamID,
audioSource:true,
publishAudio:true,
publishVideo:true,
resolution:resolution,
frameRate:30
});
On the back end in php where i make the curl request i am also setting the resolution that is passed from the front end:
// create the session
$this->start(‘sessions’);
$this->setOpt(CURLOPT_POST, true)
->setOpt(CURLOPT_POSTFIELDS,json_encode([
“customSessionId”=>$streamId,
“mediaMode”=> “ROUTED”,
“recordingMode”=> !$record ? “MANUAL” : “ALWAYS”,
“defaultOutputMode”=> “INDIVIDUAL”,
“defaultRecordingProperties”=>(object)[
“resolution”=>$resolution
]
]))
->setOpt(CURLOPT_HTTPHEADER,[
"Authorization: Basic " . base64_encode(“OPENVIDUAPP:”.$this->params->get(‘viduSecret’)),
“Content-Type: application/json”
]);
$this->run()->finish();
Even with these things it doesn’t work right. On the front end my iphone is giving me a landscape video even though i’ve clearly told it to use 720x1280 as the resolution, the recording is the same it’s landscape chopped off