Skip to content

Mirroring transform rotated upside down (front camera) #250

Description

@piv199

Hi there,

Trying to adopt this library for video recording in the project, but face strange issue. As far as I researched the issues section, this problem with mirroring mode for front camera is still actual:

#49
#113

Basically for front camera it doesn't matter where and when you set nextLevel.mirroringMode = .off - it's not mirrored on previewLayer, but the resulting video is mirrored.

Proposed solution was to apply nextLevel.videoConfiguration.transform = .init(scaleX: -1, y: 1) which works fine for apple devices. But what I faced is not all video players understand the resulting video and it gets rotated upside down.
If we look into metadata, the recorded video will have:
Rotation: 180
SIDE DATA LIST

  • Displaymatrix: 00000000: -65536 0 0 00000001: 0 65536 0 00000002: 0 0 1073741824
  • Rotation: -180

If not applying transform, everything is zero and not rotated, but mirrored. Could there be any other solutions to get resulting video without any rotation metadata or mirroring for front camera?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions