Comments (9)
Did you get a chance to make the audio working?
from gpuimage.
In File GPUImageMovieWriter.m
Function - (void)initializeMovie{
....
assetWriterPixelBufferInput = [AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput:assetWriterVideoInput sourcePixelBufferAttributes:sourcePixelBufferAttributesDictionary];
[assetWriter addInput:assetWriterVideoInput];
// *****add by me
// Add the audio input
AudioChannelLayout acl;
bzero( &acl, sizeof(acl));
acl.mChannelLayoutTag = kAudioChannelLayoutTag_Mono;
NSDictionary* audioOutputSettings = nil;
audioOutputSettings = [NSDictionary dictionaryWithObjectsAndKeys:
[ NSNumber numberWithInt: kAudioFormatMPEG4AAC ], AVFormatIDKey,
[ NSNumber numberWithInt: 1 ], AVNumberOfChannelsKey,
[ NSNumber numberWithFloat: 44100.0 ], AVSampleRateKey,
[ NSNumber numberWithInt: 64000 ], AVEncoderBitRateKey,
[ NSData dataWithBytes: &acl length: sizeof( acl ) ], AVChannelLayoutKey,
nil];
AVAssetWriterInput *_audioWriterInput = [AVAssetWriterInput
assetWriterInputWithMediaType: AVMediaTypeAudio
outputSettings: audioOutputSettings ];
_audioWriterInput.expectsMediaDataInRealTime = YES;
[assetWriter addInput:_audioWriterInput];
}
But the film still silence. Is there something wrong with this code ?
How can i capture the video with audio?
Thanks in advance!
from gpuimage.
Still no luck on my end too.
Can anyone point me to the right direction?
Thankz in advance :)
from gpuimage.
@kobenini , i followed similar approach, but no results.
from gpuimage.
I have add code as Avcam Demo in WWDC, but no audio was recorded.
from gpuimage.
Audio recording for both live video and for filtered movies should now be fully functional within the framework.
from gpuimage.
Wow! That's amazing!
Great works.
Thanks!
Audio recording for both live video and for filtered movies should now be fully functional within the framework.
Reply to this email directly or view it on GitHub:
#25 (comment)
from gpuimage.
cool
from gpuimage.
Hi All,
I am working on applying sepia filter on a video using the GPUImageSepiaFilter. The filtering go through very well but its stripping off the audio from the movie.
This is what i am doing.
-(IBAction)addFilter:(id)sender
{
movieFile = [[GPUImageMovie alloc] initWithURL:movieURL];
sepiaFilter = [[GPUImageSepiaFilter alloc] init];
[movieFile addTarget:sepiaFilter];
movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:filteredMovieURL size:CGSizeMake(1280.0, 720.0)];
[sepiaFilter addTarget:movieWriter];
movieWriter.shouldPassthroughAudio = YES;
movieFile.audioEncodingTarget = movieWriter;
[movieFile enableSynchronizedEncodingUsingMovieWriter:movieWriter];
[movieWriter startRecording];
[movieFile startProcessing];
__weak id weakSelf = self;
[movieWriter setCompletionBlock:^{
[weakSelf finishedFilter];
}];
}
-(void)finishedFilter
{
[sepiaFilter removeTarget:movieWriter];
[movieWriter finishRecording];
}
I tried to step into the code and I see when the control comes to startProcessing of GPUImageMovie.m the audioTracks is empty.
NSArray *audioTracks = [self.asset tracksWithMediaType:AVMediaTypeAudio];
Looks like the sepia filtering is taking away the audio?
Any idea on how to handle this. Any help would be great !
Thanks,
Shruthi.
from gpuimage.
Related Issues (20)
- help you to kill a bug
- How to get the buffer after using Filter? HOT 2
- Video with GPUImageMovie has a strange lines when I apply GPUImageLookupFilter HOT 2
- H
- 可以给第三方传过来的视频加美颜、滤镜吗? HOT 8
- didCompletePlayingMovie call immediately HOT 1
- photo
- How to create Ordered Dithering filter using GPUImageFilter
- 添加一些滤镜,画面出现屏闪现象
- The rapid growth of memory
- GPUImageStillCamera crash with invalid array index HOT 1
- Build input file cannot be found module.modulemap Xcode project Objective-C
- How to use Lookup Filter to Video? HOT 1
- GPUImageMovie 如何播放网络视频,同时添加滤镜效果 HOT 1
- 如何用gpuimage在一个视频里添加2种模式水印?
- ShaderDesigner[4974:64452] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x60000299bb00> F8BB1C28-BAE8-11D6-9C31-00039315CD46
- GPUimage导入使得 UIDeviceOrientationDidChangeNotification 通知接受不到
- A function declaration without a prototype is deprecated in all versions of C and is not supported in C2x
- 'AVCaptureStillImageOutput' is deprecated: first deprecated in iOS 10.0 - Use AVCapturePhotoOutput instead.
- GPUImage for Android?! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpuimage.