Loosing audio after processing in AVComposition - ios

I am using AVMutableComposition to combine two pieces of media (one video one graphic overlay). The video was captured using UIImagePickerController.
Video records fine and audio is there when previewing the recording.
Process with Composition, and export session. Video saves fine (with overlay), but no audio.
iOS7.
I'm not specifically doing anything with audio in the composition. I just assumed it would "come along" with the video file. Is that accurate, or do I need to create a dedicated audio track in the composition?
_mike

After much researching, I found the solution to this in another Stackoverflow question (and answer).
iOS AVFoundation Export Session is missing audio.
Many thanks to that user.

Related

iOS : How to apply audio effect on recorded video

I am developing an application which require to apply audio effect on recorded video.
I am recording video using GPUImage library. I can successfully done with it. Now, I need to apply audio effect like Chipmunk, Gorila, Large Room, etc.
I looked into Apple's document and it say that AudioEngine can't apply AVAudioUnitTimePitch on Input Node (as Microphone).
For solving this problem, I use following mechanism.
Record video & audio at same time.
Play video. While playing video, start AudioEngine on Audio file and apply AVAudioUnitTimePitch on it.
[playerNode play]; // Start playing audio file with video preview
Merge video and new effected audio file.
Problem :
User have to preview a full video for audio effect merge. This is not a good solution.
If I set volume of playerNode to 0 (zero). Then It record mute video.
Please provide any better suggestion to do this things. Thanks in advance.

Effect to audio and video file

In my app I want to give effect to audio and video file like it is given to Pheed Application. I want to mix audio recorded sound with predefine clips. And also want to give sound different effect like echo , surrounding Normal , And with video file I want to add different effects like sepia,.. I don't know which class library I have to use to implement6 this . Can any one suggest me any library for that or any way how to do that?
Here are a pair of libraries you can try:
For audio filters and effects you can try with The Amazing Audio Engine. It is build on top of Core Audio.
For video effects try GPUImage. I haven't tried it but it is supposed to work better than Core Image when handling videos.

Can I use an image to be a poster frame for an audio clip on iOS?

I'm using AVMutableComposition and AVAssetExportSession to composite several discrete audio clips/files together into a single file, similarly to this post but there will be no "video" track. I'd like to give the track some visual appeal using a still image so that when the user plays the clip they don't just see a generic quicktime icon, ideally I'd replace the image with branding or something relevant to the audio content. How would I go about doing it and is there a way to do it without dramatically increasing file size(ie some way to have a really slow framerate or just something so its not generating 30 fps for what is non moving art.) Appreciate any help on this.
AVAssetWriter will allow you to create video from a still image. This question provides a great example of how to do so.

iOS: analysing audio while recording video to apply image filters

I'm desperate to find a solution to the following problem: I have an iPhone application that:
can record Video and audio from the camera and microphone to a video file
perform some audio processing algorithms in real-time (while the video is being recorded)
Apply filters to the video (while it's recording) that are modified by the latter algorithms
I've accomplished all of the tasks separately using some libraries (GPUImage for the filters, and AVFoundation for basic audio processing) but I haven't been able to combine the audio analysis and the video recording simultaneously, i.e: it records perfectly the video file and applies the filters correctly, but the audio processing part just STOPS when I start to record the video.
I've tried with AVAudioSession, AVAudioRecorder and have looked all around google and this page but I couldn't find anything. I suspect that it has to do with concurrent access to the audio data (the video recording process stops the audio processing because of concurrency) but either way I don't know how to fix it
Any ideas? anyone? Thanks in advance.

iOS Capture Video from Camera and Mixing with audio file in real time

I am trying to capture video from iPhone camera and save the movie mixed with an audio file.
I can capture the video with the audio (from mic) with no problems. What I want to do is capture the video but instead of mic audio, use a music track (a .caf file).
I am capturing the video with AVAssetWriter. I've tried to set up an AVAssetReader to read the audio file, but I couldn't make it work with the AVAssetWriter (maybe because the decoding of audio happens real fast).
Also, I don't want to save the movie without audio and mix it afterwards with an AVAssetExportSession. It would be to slow for my purpose.
Any Ideas ? Thanks in advance.
Capture the video using AVAssetWriter, Capture audio lets say with AvAudioRecorder , then mix audio and video using AVExportSession , lots of posts on this topic.
If you do it after (with AVAssetExportSession) , you will problem with the sync. and short delay (time...) between the video and the audio...didn't find better solution

Resources