RootEncoder icon indicating copy to clipboard operation
RootEncoder copied to clipboard

I have got one issue while live streaming in portrait camera orientation

Open vcsvetronind opened this issue 3 years ago • 5 comments

Hi pedroSG94, I am using your library for live streaming. I am testing on the 4G HD Law enforcement recorder for which I have uploaded a screenshot. I am trying to stream in portrait resolution which is 352 x 288. But the issue I am facing is that when I am streaming in portrait but it changes to the landscape. Could you help me with this issue ?

1653297334147 1653297319695 1653297330077

vcsvetronind avatar May 23 '22 09:05 vcsvetronind

I don't understand the problem. Can you explain it better? Where is the problem exactly when you change to landscape? Can you explain desired behavior?

pedroSG94 avatar May 23 '22 19:05 pedroSG94

  • I have started streaming in portrait device mode(Vertical),
  • It shows a preview in Landscape device mode(Horizontal).

Can you please see below attachment link show (Preview video) https://www.youtube.com/shorts/OU1cufH664o

vcsvetronind avatar May 24 '22 12:05 vcsvetronind

Actually. How the f did you manage to get the video to rotate when you rotated the device like that?

BlueBazze avatar May 25 '22 07:05 BlueBazze

Actually. How the f did you manage to get the video to rotate when you rotated the device like that?

That is the issue which I am facing!

vcsvetronind avatar May 25 '22 11:05 vcsvetronind

Ok, I understand now.

Do you have prepareVideo method with rotation value setted correctly? The correct value should be like this:

prepareVideo(width, height, fps, bitrate, CameraHelper.getCameraOrientation(context);

If you have this method corerctly configured lest try other ways:

  • Use OpenGView as preview and set RotationFilter:
        RotationFilterRender rotationFilterRender = new RotationFilterRender();
        rtmpCamera1.getGlInterface().setFilter(rotationFilterRender);
        rotationFilterRender.setRotation(90);
  • If you are using Camera1 you can try with this method:
rtmpCamera1.setPreviewOrientation(90);
  • Use OpenGView as preview and set rotation to OpenGlView:
//rotate preview and stream/record
rtmpCamera1.getGlInterface().setRotation(90);
//rotate only stream/record result
rtmpCamera1.getGlInterface().setStreamRotation(90);

pedroSG94 avatar May 25 '22 21:05 pedroSG94