HybridCamera icon indicating copy to clipboard operation
HybridCamera copied to clipboard

Switch camera while recording

Open blurtime opened this issue 5 years ago • 10 comments

Here a couple of resources regarding this issue. The first one sounds pretty nifty so that might be a good way to solve this problem:

  1. https://stackoverflow.com/questions/13951182/audio-video-out-of-sync-after-switch-camera/54770398#54770398
  2. https://stackoverflow.com/questions/44577331/multiple-avcapturevideodataoutput-in-same-avcapturesession
  3. https://stackoverflow.com/questions/47983572/switch-between-front-and-back-camera-while-recording-a-video
  4. https://stackoverflow.com/questions/40494841/seamless-audio-recording-while-flipping-camera-using-avcapturesession-avasset (added on 9/17/19)

blurtime avatar Jul 30 '19 14:07 blurtime

Hi @eonist, I found 4. today and thought it might be worth looking into. I played around with the code a bit but couldn't figure anything out - probably because the protocols for the buffering don't seem to be implemented in the project yet (unless I missed something) and one would have to rewrite a lot of code. Anyway, hope you're doing well and maybe have a little time to check it out. :D Moritz

blurtime avatar Sep 18 '19 19:09 blurtime

Hey man, packed at work at the moment. Switching channels while recording is a deep task. Aka requires deep focus. Its exciting to see Apple embracing this feature in their new camera app. If you havnt seen the Apple event, it had a segment about this feature. Even recording both cams at the same time.

eonist avatar Sep 19 '19 06:09 eonist

I'll watch it right away! Thank you! No worries, it's not that big of a deal :)

blurtime avatar Sep 19 '19 13:09 blurtime

If I can't add features my self, because of work commitments, I'll probably start funding them through issuehunt.

eonist avatar Sep 20 '19 06:09 eonist

That would be pretty cool! I really love this camera library for recording videos and taking photos so seamlessly. It starts recording without any lags whatsoever - so absolutely smoothly! Just switching the camera would be a nice feature :D

blurtime avatar Sep 20 '19 08:09 blurtime

Yeah, I think I focused a lot on nailing the zero-lag part. I just did deep focus for a week to get the core stuff right. Then refactored now and then, and people added code etc. Like you. I will start funding this project next month or start improving it my self. Either or. Stay tuned ;)

eonist avatar Sep 20 '19 10:09 eonist

You really did nail that part! Couldn't imagine using any other library exactly for this fact! Really looking forward to improvements (especially or currently only to switching while recording)! Maybe one could come up with some special ideas like filters (or something crazy), too, which would make this library stick out to an even greater extent - if there's time obviously. I'll probably launch my app in April and will be very happy to use this library 😌😁

blurtime avatar Sep 26 '19 22:09 blurtime

Filters is super easy. Lets do that next. I did a code quality refactor yesterday, going to add better error handling with the swift 5 Result-type today. And then probably Add AutoLayout based UI in a fresh Xcode scheme.

eonist avatar Sep 27 '19 05:09 eonist

Sounds awesome, looking forward to it! 😃 My next semester will start next week so I'm not sure how much time I will have. If I do have some time on my hands, I'll hit you up and try to help out :)

blurtime avatar Sep 27 '19 12:09 blurtime

Added support for switching the different back-camera types. Its just a simple implementation. Working on support for triple camera module that iPhone 11 pro has now.

eonist avatar Oct 03 '19 16:10 eonist