What are the best audio settings when recording video on iOS?

I want to record the best sound quality when recording video . I guess that would mean "no compression" for audio. However, I still need to set the compression options for the audio track, and I cannot find the combination that I should use. For all the examples I can find, they set it to MPEG4 / MPEG4AAC / H.264 for the entire recording.

This works (simplified):

NSDictionary *audioCompressionSettings = 
   [NSDictionary dictionaryWithObjectsAndKeys:
        kAudioFormatMPEG4AAC, AVFormatIDKey,
        44100.0, AVSampleRateKey,
        128000, AVEncoderBitRatePerChannelKey,
        1, AVNumberOfChannelsKey,
        currentChannelLayoutData, AVChannelLayoutKey,
        nil];

      

In the above code, I am choosing MPEG4AAC as the codec for the audio. However, I want to try and use the lossless format to see if it has better sound (like recording instruments or other music, etc., with built-in microphone / headphones or even third-party equipment connected). For videos, I use AVVideoCodecH264

for AVVideoCodecKey

, and I think it might be part of the problem, but I don't know where to look for solutions.

As I understand it, iPhones aren't capable of recording above 44.1khz, but I don't know anything about bitrate or other settings. If I just changed the format from kAudioFormatMPEG4AAC

to kAudioFormatAppleLossless

or kAudioFormatLinearPCM

, it won't write. They seem to be incompatible with other settings.

What combination should I use to record video when I want the absolute highest quality audio (and when file size is not a factor)?

+3
ios iphone video avfoundation audio


source to share


No one has answered this question yet

Check out similar questions:

21
Selecting a video codec for screen recording
3
EXC_BAD_ACCESS with AVAssetExportSession and AVMutableComposition
2
Videos recorded in video sometimes do not play audio when played on the phone
1
Why am I only getting a few audio samples per second when using AVAssetReader on iOS?
1
Recording video in C #
1
Is it possible to transcode various videos to H.264 at almost the same quality using FFmpeg?
0
What is the best solution for converting old videos to newer more optimized formats
0
iPhone SDK Smaller CAF Files: Lower Quality Recordings with Audio Queues?
0
What video encoding is suitable for playing with javafx?
0
Setting video bitrate in FFmpeg



All Articles
Loading...
X
Show
Funny
Dev
Pics