1

I try below code to rotate VideoFrame by 90 degree but it doesn't work:

private VideoFrame rotateFrame(VideoFrame inVideoFrame) {
    VideoFrame outVideoFrame = new VideoFrame(
            inVideoFrame.getBuffer(),
            90, inVideoFrame.getTimestampNs());
    return outVideoFrame;
}

What's correct logic to rotate a videoFrame?

lucky1928
  • 8,708
  • 10
  • 43
  • 92

1 Answers1

0

I have same problem but your code it's work for me.

I publish stream to Wowza Streaming Engine using webRTC and I try to debug my code while video frame publish to wowza. The orientation is 270. When I received this orientation back from service. it's 0 I try to change it before pass this frame to SurfaceViewRenderer. It's work.

remoteVideoTrack.addSink {
   remoteView?.onFrame(VideoFrame(it.buffer, 270, -1))
 }
Prateek Gupta
  • 2,422
  • 2
  • 16
  • 30