Open punto338 opened 1 month ago
Hello,
You have a code example to support rotation here: https://github.com/pedroSG94/RootEncoder/tree/master/app/src/main/java/com/pedro/streamer/rotation
Hello,
You have a code example to support rotation here: https://github.com/pedroSG94/RootEncoder/tree/master/app/src/main/java/com/pedro/streamer/rotation
I am trying to streaming portrait and landscape mode and both make output of 1920x1080, so in portrait mode I get black space on the sides, is any way to make the output same size as the video? I see OK when in the device which is streaming but in the "player" device its wrong, see next comment:
See pictures, first one is landscape, which is OK, and the other one is portrait mode but it seems video is outputing in landscape mode:
Hello,
This is the expected result.
You can't change the video size while you are streaming/recording so the video is adapted depend of the device orientation to avoid distortion. You can choose use 1080x1920 and you will have the same case but inverted (portrait is filled and landscape with black borders).
I mean I am not trying to change video size while streaming. Use case:
-I have portrait camera, it show in my preview fullscreen and good, then I start recording and in the player I get an output of 1920x1080 with the streaming small in the middle, and black on the sides
This is my code. Its working in landscape but not in portrait. bestSize is 2400 width 1080 height
Size bestSize = getBestCameraResolution();
genericStream.getGlInterface().setAspectRatioMode(AspectRatioMode.Fill);
genericStream.getGlInterface().setAutoHandleOrientation(true);
genericStream.prepareVideo(bestSize.getWidth(), bestSize.getHeight(), 1200 * 1000);
genericStream.prepareAudio(32000, true, 128 * 1000);
@pedroSG94 I was able to fix this with the rotation in prepareVideo() method with this code, similar to the example you gave:
genericStream.prepareVideo(width, height, vBitrate, rotation = rotation)
genericStream.prepareVideo(
bestSize.getWidth(),
bestSize.getHeight(),
1200 * 1000,
30,
2,
getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT ? 90 : 0
);
How can I set just the orientation like you using Java, without setting fps and iFrameInterval param? If not possible, which are the default values for fps and iFrameInterval ?
Hello, I have a problem when streaming in landscape mode. I want to keep streaming when rotating screen so video output now should be in portrait mode. I have this code but it seems release() method cancels the streaming. I need to keep sending video without stopping streaming and starting again, any idea?