flutter_rtmppublisher
flutter_rtmppublisher copied to clipboard
IOS Orientation
Hi! I am running your demo app on a physical IPhone and am not able to get the RTMP stream to switch from portrait to landscape. I really just need the stream to in landscape.
Not sure if this is a bug or intended.
Getting the same issue here. Tried manually setting up orientation switching through the HaishinKit and had no luck.
Weird I did get it to switch. It sticks on one orientation once you start though
On Tue, Aug 4, 2020, 4:07 PM sbruler [email protected] wrote:
Getting the same issue here. Tried manually setting up orientation switching through the HaishinKit and had no luck.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pinkfish/flutter_rtmppublisher/issues/24#issuecomment-668870184, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATOMMJLZJA47P3XFGXGLFLR7CIEFANCNFSM4PK7TQZQ .
Weird I did get it to switch. It sticks on one orientation once you start though
Thanks for the reply. Can you share how you configured it? Maybe I'm approaching it incorrectly.
I was able to get the web player to force portrait mode by setting these values in the FlutterRTMPStreaming.swift file.
@objc public func addVideoData(buffer: CMSampleBuffer) { if let description = CMSampleBufferGetFormatDescription(buffer) { let dimensions = CMVideoFormatDescriptionGetDimensions(description) rtmpStream.orientation = .landscapeLeft rtmpStream.videoSettings = [ .width: 1920, .height: 1080, .profileLevel: kVTProfileLevel_H264_Baseline_AutoLevel, .maxKeyFrameIntervalDuration: 2, .bitrate: 1200 * 1024 ] rtmpStream.captureSettings = [ .fps: 24 ] } rtmpStream.appendSampleBuffer( buffer, withType: .video) }
But I was not able to get the actual IOS camera to rotate to landscape mode, it is stuck in portrait and the end result is a cropped view of the landscape camera preview.
This is a (rotation) locked view.
This is a (rotation) free view.
This is the end result in both cases, even after restarting the app and starting in either orientation.
Any help from either of you with this issue would be greatly appreciated.
This issue is pretty serious for me. I've been trying to debug the code myself, but previewQuarterTurns is often null (maybe always?) and doesn't affect preview rotation on iOS anyway. Android seems to work fine.
Glad to chip in a few bucks to get this prioritized:)
Part of the problem is in RtmppublisherPlugin.m (ios code):
connection.videoOrientation = AVCaptureVideoOrientationLandscapeLeft; //AVCaptureVideoOrientationPortrait;
i swapped in a hard-coded landscape value for the AV capture, but now both the preview and broadcast dimensions are screwed up.
@burtonmiller Just wanted to check in and see if you ever found a solution for this?
Take it nothing has changed here?
Anyone found the solution or workaround for this issue? (iOS RTMP stream always in portrait mode, android works fine).