Closed blurtime closed 4 years ago
Note: If you add the same code in the init
of "BBMetalCamera.swift" and initialize the camera with .front
, the video won't be mirrored which is odd (EDIT: in the resulting video file!). After switching twice it will be, though. I have seen some other pods facing the same problem, too, so I'm guessing it is something you cannot influence. My provisional solution is to just initialize with the .back
camera which is fine, too.
Maybe it's not necessary. To mirror texture, use BBMetalFlipFilter
. To mirror BBMetalView
for display only, set bb_textureMirroring
property to true.
Well, I guess this is the more elegant solution I was referring to. I'll close the pull request :)
Important note: I tried the flip filter but found that only the vertical flip would be accounted for in the resulting video file. Therefore, it seems as though the horizontal flip will still have to be achieved by mirroring the connection. You can easily try it out by recording yourself with the flip - applied as in the demo - and keeping your face on the right side of the screen. The resulting file will make it look like you were keeping your face on the left while accounting for the vertical flip. You can choose if you'd like to reopen the pull request.
The resulting video won't be mirrored when the front camera is used - unlike Snapchat, Instagram, etc. do it. I would suggest changing the mirroring when using the front camera. Now, however, the mirroring looks weird while recording so I added a transform to the
metalView
when the front camera is being used (although I'm sure there are more elegant solutions to achieve this more generally).