0

I am currently working on Camera View for a project which is already exist. My app is giving an error when I run the app. The main problem is that I am getting errors while running the project. The error is like mediaType with AVMediaTypeVideo. You can see here.

enter image description here

I tried different options and I found that there is some changes in AVFoundation.

The next problem is related to the first since I am using the AVFoundation for my camera implementation on the top right corner I have a red error message which describes as in the image here.

enter image description here

It does not matter which language you have solution, it can be both Siwft and Objective-C.

If someone know anything about this issue please share it here and it would be very appreciated.

Thanks!

Naresh
  • 16,698
  • 6
  • 112
  • 113

1 Answers1

1

Your code working fine for me.

AVCaptureConnection *connection = [_movieFileOutput connectionWithMediaType:AVMediaTypeAudio];

for (AVCaptureInputPort *port in [connection inputPorts]) {
    if ([[port mediaType] isEqual:AVMediaTypeVideo]){
        NSLog(@"Media is Video type");
    }
}

Quit the Xcode and run again.

technerd
  • 14,144
  • 10
  • 61
  • 92
  • Hey @technerd Me and my team stuck hours on an issue very similar to what you've posted here. Any chance you can take a quick look? Ah, we are so frustrated. : https://stackoverflow.com/questions/49235811/avassetwriter-avvideoexpectedsourceframeratekey-frame-rate-ignored/49236475#49236475 – Roi Mulia Mar 12 '18 at 17:28