[Webkit-unassigned] [Bug 198912] New: [iOS] MediaRecorder incorrect screen orientation handling

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 17 03:27:09 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=198912

            Bug ID: 198912
           Summary: [iOS] MediaRecorder incorrect screen orientation
                    handling
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: iPhone / iPad
                OS: iOS 12
            Status: NEW
          Severity: Blocker
          Priority: P2
         Component: Web Template Framework
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: igor at vima.swiss

When using MediaRecorder to recording a file in portrait mode, for ex. recording a video message using the frontal camera, Safari automatically switches width/height (640x480 => 480x640) but does not applies necessary transformation which results the video track to be rotated 90deg thus stretching the video making it hardly usable, please see [1].

Similar kind of distortions, upside-down video, etc. could be observed while holding the phone in any other orientation except landscape with camera on the right side.

After looking at the source code I discover recording is performed using AVAssetWriterInput[2]. According to the dev docs [3] the issue could be resolved using the "transform" property to rotate the image according to the current device orientation [5]. You can find an example of transformation for each screen orientation via the following link [6].

I would be glad to provide a patch, unfortunately iOS Simulator does not supports webcams nor it is possible to deploy a debug version of WebKit to an iOS device.

Please let me know if I can help with any further debugging.

Thank you very much in advance,
Igor

[1] https://www.dropbox.com/s/3kdx77bmw2mghvi/Vid%C3%A9o%2017.06.19%2011%2052%2040.mp4?dl=0
[2] https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h#L70
[3] https://developer.apple.com/library/archive/qa/qa1744/_index.html#avassetwriter
[4] https://developer.apple.com/documentation/avfoundation/avassetwriterinput/1390183-transform
[5] https://github.com/remirobert/CameraEngine/blob/master/CameraEngine/CameraEngineVideoEncoder.swift#L130
[6] https://github.com/remirobert/CameraEngine/blob/master/CameraEngine/CameraEngineVideoEncoder.swift#L83-L86

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190617/7a673503/attachment.html>


More information about the webkit-unassigned mailing list