piemonte / PBJVision

📸 iOS Media Capture – features touch-to-record video, slow motion, and photography
MIT License
1.93k stars 324 forks source link

Separate Mirroring Modes for Preview vs Capture? #322

Closed patgoley closed 2 years ago

patgoley commented 8 years ago

Hello! First of all, thanks for a great framework, it's saved me tons of time and headache. I've hit one limitation though, which is that I'd like to mirror the preview when using the front facing camera, but still have the captured image/video be in the correct, non-mirrored orientation. This is how the iOS Camera app functions as far as I can tell, which is the behavior that most people have come to expect. So two questions:

  1. Is there currently any support for this?
  2. If not, is it as simple as having two mirroringMode properties, one for preview and one for capture? Then we'd just split up that setter method so each one is applied to the videoConnection and previewConnections separately?

I'm happy to contribute a PR if you think this is a worthwhile feature. Even if you don't, any advice or direction I should take on my fork to accomplish this would be most helpful. Thanks!

piemonte commented 8 years ago

Hey @patgoley thanks so much. Recently started a capture library in Swift that should be done in a day or so, working to make that the future. Check it out if you have time: http://nextlevel.engineering/

In terms of your questions, this isn't currently supported – just haven't tried or experimented with such an idea. The approach you mention is what I'd try first. Another approach would be to apply a transform to the recorded video, using some type of rendering context, from core image or OpenGL. Feel free to submit a PR for the feature, a secondary property is cool. 👍