FASTEST way to Make a CAMERA APP with Swift AVFoundations
Вставка
- Опубліковано 24 лип 2024
- FASTEST way to Make a CAMERA APP with Swift AVFoundations
Escape Tutorial Hell 👉 rebeloper.com/mentoring
You have to know everything about avfoundation in order to build a decent app.
Want to learn avcapturedevice and swift avfoundation, then this video is perfect for you! In this iOS AVFoundation video you will learn about avvideocompositioncoreanimationtool, audio player, swift camera, swift do catch and swift basics in general. You will learn how to create snapchat with the help of this avfoundation tutorial. In this camera tutorial I will walk through things like avkit vs avfoundation, custom camera swift, swift audio player and much more! This avvideocompositioncoreanimationtool tutorial is a swift course. These swift for beginners videos will teach you how to learn swift programming and swift app development. Don’t forget to subscribe to my UA-cam channel for more swift 5 tutorial and swift ios development. I talk a lot about ios software, ios play music and SwiftUI.
So if you want to learn AVFoundation then keep watching!
Let's dive into this AVFoundation video by Rebeloper!
Don’t forget to download the resources:
→ store.rebeloper.com/youtube-c...
**VIDEOS I RECOMMEND**
→ PLAYLIST:
Navigation:
• Navigation in SwiftUI ...
DO YOU WANT TO BE MY APPRENTICE?
HIRE ME → rebeloper.com/hire-us/
TOOLS I RECOMMEND:
→ rebeloper.com/tools
__________
Say hi on social:
Get in touch:
→ support@rebeloper.com
SUBSCRIBE to weekly tips & tutorials for building iOS apps!
→ ua-cam.com/users/rebeloper?su...
Github: github.com/rebeloper/
Hire me: rebeloper.com/hire-us/
LinkedIn: / rebeloper
My Blog: rebeloper.com/blog
Follow me on Instagram: / rebeloper
____
• FASTEST way to Make a ...
#rebeloper
CHAPTERS:
_____
00:00 INTRO
00:21 THE PLAN
02:06 CAMERA SERVICE
16:10 CAMERA VIEW
27:16 CUSTOM CAMERA VIEW
33:00 SHOW AND USE CAMERA
39:45 WHAT TO DO NEXT - Наука та технологія
Do you think using AVFoundation is easy?
Not quite, fortunately there are many examples online
@@jsonbourne8122 Of camera app using SwiftUI? Please send the links lol
You absolutely right. Very few tutorial on UA-cam but they are not up to the mark but you rock iiiiiiiittttttt.
Glad I could help! :) BTW check out a video about THE MISSING view from SwiftUI: ua-cam.com/video/cUnxa87qNoQ/v-deo.html
Thank you for this tutorial.
The only strange thing I'm facing is with the front camera of an iPad Air 5th generation. The camera picture within the preview view looks nice and has warm colors, but the UIImage fetched from the camera seems to have a bit colder colors and looks like the photo was saved as low quality JPEG... so a lot of artifacts. Where does this come from? Because it is not within the code. Does iOS do any automagics?
On an iPhone 12 Pro everything looks much better, but still there is a big difference between the preview and the final image.
Hmm... that's frustrating. Unfortunately I don't have answer for this.
BTW here are 6 things I wish I knew about SwiftUI when I started 👇
ua-cam.com/video/EZz9NL4H0Ug/v-deo.html
This is really great! Can you make a follow up video on this using UIKit instead and adding focus/autofocus and other settings like flash? Thank you.
Thanks for the compliment. Unfortunately i am not using UIKit for 1.5 years now. BTW Did you know? Apple is Finally FIXING SwiftUI at WWDC (My Wish List) 👉 ua-cam.com/video/CbjESSsCogo/v-deo.html
you're amazing, thank you!
Happy to help! Also check out How to Develop iOS and macOS Apps in VSCode 👇
ua-cam.com/video/yWdC5Kg6nIA/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
Hey! amazing video! I was wondering what would be the steps if user wants to post the captured photo in the app
You can use Firebase for that. Let me show you on a mentoring session: rebeloper.com/mentoring
BTW Becoming A Front End Developer Takes Time 👉 ua-cam.com/video/Hx2tE19jYn8/v-deo.html
How different would this be if we wanted to record a video instead? I would like to make an app that records videos and saves it locally
This can be the basis for a video capture app. You need to add a bit more complex code though. BTW if you did like this video I think you will enjoy "How to Publish an App to the App Store": ua-cam.com/video/ykiD5wqwSe4/v-deo.html
How to create a custom camera for video recording which supports different Zoom (1x, 1.5x, 2x etc depending on device) in real time?
That's a bit hard to do. Let me explain in a mentoring session: rebeloper.com/mentoring
how tikTock is using video capture? user has ability to stop/resume recording as well as the main thing delete last fragment of captured recording .. any guidance on that?
For that you'll need a bit more of AVFoundation. Unfortunately I'm not that fluent in that. :(
Question: Is MVVM Good for SwiftUI? 👇
ua-cam.com/video/LHMUIc7jq_w/v-deo.html
Great Video! I want to use a captured image as a overlay for the next image but I can't align them properly.. Do you know how I can solve it?
I can help you in a mentoring session: rebeloper.com/mentoring
BTW did you know that now you can Instantly Make BETTER Looking Prototypes in SwiftUI (and UIKit) 👉 ua-cam.com/video/5JO1228HUJE/v-deo.html
did you ever figure this out? I am having the same issue!
Thanks for the video, it was very useful. I am developing an app and I also want to gather accelerometer data using CMMotionManager. Now what happens is that if I take a picture without enabling the CMMotionManager, the picture is saved properly. However, if I first start gathering accelerometer data and then take a picture, the picture is not saved. I'm very new to app dev and to Swift so I might be missing something very obvious, but any ideas on why that happens?
To properly answer your question I would need to take a look at your code. You can book a mentoring session with me here: rebeloper.com/mentoring
Next watch what's new in SFSymbols 5 👉 ua-cam.com/video/rb6Sgvf6PmE/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
Any chance you could direct link the videos you mention on Result type and ViewControllers and any other mentions in the about section. You have several different videos that pop-up when those terms are searched on your channel. -- thanks, great resource btw.
Watch the latest ones. I like to update myself.
Next Learn FizzBuzz: One Simple Interview Question 👇
ua-cam.com/video/at5NQdCGxyc/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
This was awesome. Thanks!
Glad you enjoyed it! If you enjoyed this video you will love Animated Splash Screen iOS: ua-cam.com/video/mMl6t6gpB1o/v-deo.html
@@rebeloper Thank you! I'm checking this out now.
Good to hear. BTW if you enjoyed this tutorial make sure you take a look at my latest video about Progress Indicator Examples: ua-cam.com/video/nHr2hh-KgTk/v-deo.html
@@rebeloper Thank you very much. Great content. I really appreciate it.
Can you please tell me how can I switch the camera the view from back to front?
That's a bit hard. Consider booking a call: rebeloper.com/mentoring
BTW check out REALM: What is it and why should I use it? 👉 ua-cam.com/video/lck0y1kZxww/v-deo.html
If you need to use it in multiple views you need to reset the output. Change output from let to var and add this at line 51:
if !session.canAddOutput(output) {
session.removeOutput(output)
output = AVCapturePhotoOutput()
}
Thanks for the solution.
Next Learn FizzBuzz: One Simple Interview Question 👇
ua-cam.com/video/at5NQdCGxyc/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
Does this code work in macOS as well? If not is there a way to make it work? Great video btw!
Unfortunately no. BTW Check out WWDC22 Day 2: What's cooking in SwiftUI 👉 ua-cam.com/video/WzAtieE0dbE/v-deo.html
Unfortunately, I must have created an incorrect project type as much of the UI didn't match. Maybe adding the couple of seconds at the start to show this would have allowed me to continue or maybe a year later Xcode has changed too much to match this tutorial
Yes, it's a quite old project. Things change so fast with Xcode. Next check out SwiftUI Navigation Perfected: Harnessing NStack's Game-changing Capabilities 👇
ua-cam.com/video/nrtr14iOj0E/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
Hello, how would you add a method to record videos?
That is way harder for a comment or a video actually...
Next watch the new Map in SwiftUI 👇
ua-cam.com/video/4hLEKVTSjVk/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
This works for me fine as an app by itself but once I put it into my bigger app it crashes once you take the picture. I'm getting an error where delegate in the capturePhoto function is unexpectedly nil. Any idea on why this would be the case? It does work about 10% of the time.
I heard that it crashes on iPhone 11 sometimes. Are you using an iPhone 11?
Next you might want to downgrade from iOS17 beta to iOS16: ua-cam.com/video/fhPNYEOGamo/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
I am facing the same issue. Any solution to this? Using iPhone 12 with iOS 17.
Hii sir i also create a camera app in that app i try to add a portrait effect mode like real camera app i can't do this..help me sir
You can book a mentoring session with me and I can take a look at your project: rebeloper.com/mentoring
Next watch OpenAI Images In SwiftUI Project With Amazing GitHub Repository 👇
ua-cam.com/video/KN8Ls7oKqd0/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
Hi, thanks for tutorial, but i does not work for me.. after taking picture there is an error in function capturePhoto - no active and enabled video connection. Any idea what is wrong? Thanks
Hmm. I don't really know...
BTW check out REALM: What is it and why should I use it? 👉 ua-cam.com/video/lck0y1kZxww/v-deo.html
Same here. To fix it replace *"let output = AVCapturePhotoOutput()"* with the type *"var output: AVCapturePhotoOutput?"* and add *"let output = AVCapturePhotoOutput()"* under *"let session = AVCaptureSession()"* (inside the setupCamera function). Also add *"self.output = output"* under *"self.session = session"*. The problem was that a new output wasn't being generated after photo capture.
is AVcam the same thing as ios camera app ? does it have the same exif data ? also, how can I make a custom camera with a watermark in a custom format to overlay on each photo or video ?
So much to cover in one comment. Let's see how I can help you in a 1:1 mentoring session: rebeloper.com/mentoring
Next check out SwiftUI Coordinator Pattern: Everything You Need to Know 👇
ua-cam.com/video/sikBA9n5H2k/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
@@rebeloper what us this ?
After taking the photo and dismiss the view, the green LED of the camera remains on. How can i solve?
Thanks for your work.
Resolve: I added parent.cameraService.session?.stopRunning() in photoOutput function... is correct?
That is correct. BTW if you did like this video I think you will enjoy "How to Publish an App to the App Store": ua-cam.com/video/ykiD5wqwSe4/v-deo.html
i follwed the tutorial and camera was working fine but suddenly it is my app crashes when i click on capturing photo because i am forcing unwrap a optional value which is delegate in capturePhoto function { output.capturePhoto(with: settings, delegate: delegate!)}
This video is quite old by now. If you want to I can take a look at your code on a mentoring session: rebeloper.com/mentoring
Next check out the World's Shortest SwiftUI Course 👉 ua-cam.com/video/zJo6KbeM9Jk/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
Did you find solution how to fix?
hey my friend; been a while since I had a chance to come across one of your videos. hope you are well!
Thanks for the visit. I'm doing great. BTW Check out WWDC22 Day 2: What's cooking in SwiftUI 👉 ua-cam.com/video/WzAtieE0dbE/v-deo.html
@@rebeloper Ah yes of course, early June has arrived indeed; hence, WWDC. Glad to hear you are good my friend! Will check it out as soon as I get a chance. Cheers!
Nice! BTW check out REALM: What is it and why should I use it? 👉 ua-cam.com/video/lck0y1kZxww/v-deo.html It's my lates video on the channel.
Will this support center stage??? Camera tracking?
Nope, that is part of the FaceTime app. Next check out the FUTURE of SwiftUI Navigation View: ua-cam.com/video/pGqoV31qtsA/v-deo.html
Great video. for me the camera view comes up black with no video. Any idea?
Have you set up the Info.plist file?
How are you testing your projects? Is it TestFlight? How to use TestFlight - Full Guide 👇
ua-cam.com/video/cdUVbpT-Vks/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
@@rebeloper I am running the app on my phone directly. not using TestFlight
Yes, I have setup the info.plist file
Hmm... I don't really know what could be going wrong. I can take a look at your code if you want to. Book a mentoring session here: rebeloper.com/mentoring
Next watch The Secret Tool Every Designer and Coder Needs: Design Overlay Collaboration Explained 👉 ua-cam.com/video/mvQf7pDQOps/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
Any Idea about creating own Camera SPM?
No yet.
Next Unlock the Power of Markdown in SwiftUI with THIS Hack! 👇
ua-cam.com/video/gVy06iJQFWQ/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
I just hate AVFoundation. 😢
I want to get the 60fps video preview in an app. Exactly like in the default camera app, but it does not work. Limited to 30fps.
And also I have tryed everything to add any visual effect. Nothing, no color grading, contrast, saturation, nothing worked (talking about the filters) the only thing I managed to control is the lens, iso and exposure time… 😢
Yes, AVFoundation is quite hard.
Next check out WWDC23: You're NOT Ready for this WWDC23 Wish List! 👇
ua-cam.com/video/msjk6CJpcY8/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
Can you do this for MacOS? :)
I haven't tested, but it should work.
Next learn about @Observable @Bindable in iOS17 - SwiftUI Data Flow 👇
ua-cam.com/video/Igblg7c2T1o/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
nice
Thanks. Next watch How Xcode 15's 6 Preview Features Will Revolutionize Your Development 👇
ua-cam.com/video/m07mlq2v6Vs/v-deo.html&ab_channel=Rebeloper-RebelDeveloper
swift ui > uikit.
Totally agree. Next check out SwiftUI Navigation for Dummies 👇
ua-cam.com/video/DugBVFJ9jRI/v-deo.html&ab_channel=Rebeloper-RebelDeveloper