Open AshishPatel48 opened 7 years ago
Hi I have create Function
-(void)filterVideoFileTestCase { if(_videoFrameRecorder != nil && [_videoFrameRecorder videoLoopRunning]) { [_videoFrameRecorder end]; [_videoFrameRecorder clear]; _videoFrameRecorder = nil; return; }
NSURL* video2Save = [NSURL fileURLWithPath:[NSHomeDirectory() stringByAppendingPathComponent:@"Documents/photoVideo.mp4"]];
NSDictionary* videoConfig = @{
// @"sourceAsset" : (AVAsset*)sourceAsset //input video Asset(Choose just one of "Asset" & "URL")
@"sourceURL" : _defaultVideoURL, //input video URL (Choose just one of "Asset" & "URL")
@"filterConfig" : [NSString stringWithUTF8String:config], //Filter String (optional)
@"filterIntensity" : @(0.9f), //filter intensity (default 1.0, rane [0, 1])
@"blendImage" : imgVideo, //blend image (optional)
@"blendMode" : @(CGE_BLEND_OVERLAY), //blend mode (nonsense if there's no blend image), see: CGETextureBlendMode
@"blendIntensity" : @(0.8f) //blend intensity (default 1.0, range [0, 1])
};
_videoFrameRecorder = [CGEVideoFrameRecorder generateVideoWithFilter:video2Save size:CGSizeMake(0, 0) withDelegate:self videoConfig:videoConfig];
}
But Delegate method do not calling
-(void)videoReadingComplete:(CGEVideoFrameRecorder *)videoFrameRecorder{
Can u please let me know what is the issue..?
The source code is just there. Please track the code
please let me know how to save the filtered video...?
@Pemmasaniaruna the test case will show you: https://github.com/wysaid/ios-gpuimage-plus/blob/master/demo/cgeDemo/SimpleTestCasesViewController.m#L237
-(void)filterVideoFileTestCase { imgVideoGet = TRUE;
if(_videoFrameRecorder != nil && [_videoFrameRecorder videoLoopRunning])
{
[_videoFrameRecorder end];
[_videoFrameRecorder clear];
_videoFrameRecorder = nil;
return;
}
NSURL *url = _defaultVideoURL;//[[NSBundle mainBundle] URLForResource:@"test" withExtension:@"mp4"];
// NSURL *url = _defaultVideoURL;
NSURL* video2Save = [NSURL fileURLWithPath:[NSHomeDirectory() stringByAppendingPathComponent:@"Documents/photoVideo.mp4"]];
NSDictionary* videoConfig = @{@"sourceURL" : url,
@"filterConfig" : [NSString stringWithUTF8String:config], @"filterIntensity" : @(0.9f),
@"blendMode" : @(CGE_BLEND_OVERLAY),
@"blendIntensity" : @(0.8f) };
_videoFrameRecorder = [CGEVideoFrameRecorder generateVideoWithFilter:video2Save size:CGSizeMake(0, 0) withDelegate:self videoConfig:videoConfig];
}
(void)filterButtonClicked: (MyButton*)sender { _currentFilterIndex = [sender index]; NSLog(@"Filter %d Clicked...\n", _currentFilterIndex);
const char* config = g_effectConfig[_currentFilterIndex]; [_videoPlayerHandler setFilterWithConfig:config]; }
Hi @Pemmasaniaruna u can save like this way in iOS Swift 3
_videoFrameRecorder = [CGEVideoFrameRecorder generateVideoWithFilter:video2Save size:CGSizeMake(0, 0) withDelegate:self videoConfig:videoConfig];
after executing the above line of code next line is not executing ...please help me
hi @AshishPatel48 we are working on objective-c
@Pemmasaniaruna Have you tried the test case in the demo?
@wysaid yes i tried if i use the code in my project everything is working fine but after "_videoFrameRecorder = [CGEVideoFrameRecorder generateVideoWithFilter:video2Save size:CGSizeMake(0, 0) withDelegate:self videoConfig:videoConfig];" this line nothing is happening and also i cant able to debung
The instance variable _videoFrameRecorder
must be retained or kept by other variables, or it may be dealloced because of the ARC
.
@wysaid in demo " The video preferred rotation: 0" but in my project " The video preferred rotation: 1.5708" i find this issue after this line no line is executing.please help me
Both rotation are supported. It's not the problem.
NSURL *url = _videoUrl;
NSURL* video2Save = [NSURL fileURLWithPath:[NSHomeDirectory() stringByAppendingPathComponent:@"Documents/photoVideo.mp4"]];
NSDictionary* videoConfig = @{
// @"sourceAsset" : (AVAsset*)sourceAsset //input video Asset(Choose just one of "Asset" & "URL")
@"sourceURL" : url, //input video URL (Choose just one of "Asset" & "URL")
@"filterConfig" : [NSString stringWithUTF8String:g_effectConfig[_currentFilterIndex]], //Filter String (optional)
@"filterIntensity" : @(0.9f), //filter intensity (default 1.0, rane [0, 1])
@"blendImage" : [UIImage imageNamed:@"mask1.png"], //blend image (optional)
@"blendMode" : @(CGE_BLEND_OVERLAY), //blend mode (nonsense if there's no blend image), see: CGETextureBlendMode
@"blendIntensity" : @(0.8f) //blend intensity (default 1.0, range [0, 1])
};
_videoFrameRecorder = [CGEVideoFrameRecorder generateVideoWithFilter:video2Save size:CGSizeMake(0, 0) withDelegate:self videoConfig:videoConfig];
above line of code am executing..
So what is the difference between your code and the origin demo?
nothing ,,but still am unable to save the filterd video
pod 'libCGE', :git => 'https://github.com/wysaid/ios-gpuimage-plus-pod.git'
am using pod like this
cgeTest.zip Check this, and see what's wrong with you.
_videoFrameRecorder is getting nill in my case.
@Pemmasaniaruna Can you run the demo above? Is it getting nil on your device?
problem is in my project not in demo ....but photo thing is working fine only for filterd video saving giving issue after that line of code whole application is going to stuck.
If so…… I can't find your problem now……
demo is also not work
@indulgeIn The demo is right on my device. You can provide your device type.
Hi,
I am iOS developer, Can you please let me know how to get video after filtering, I didnt get filter video URL.
Thanks, Ashish