Sunset Lake Software - Comments for "Looping with GPUImageMovie"
http://www.sunsetlakesoftware.com/forum/looping-gpuimagemovie
Comments for "Looping with GPUImageMovie"enWould it be possible for you
http://www.sunsetlakesoftware.com/forum/looping-gpuimagemovie#comment-1696
<p>Would it be possible for you to post the project or the entire view code? For some reason it seems to be causing the movie to not play back through the whole duration, but I'm guessing something is wrong with the way I'm listening for the notification.</p>
<p><div class="quote-msg"><div class="quote-author"><em>dansinclair25</em> wrote:</div>I have the video looping working really well.</p>
<p>In the <span class="geshifilter"><code class="cocoa geshifilter-cocoa">-(void)endProcessing</code></span> in GPUImageMovie.m i've added a simple NSNotificationCenter postNotification command to tell the system that the video has stopped processing;</p>
<p><div class="geshifilter"><pre class="geshifilter-cocoa">- (void)endProcessing;
{
for (id<GPUImageInput> currentTarget in targets)
{
[currentTarget endProcessing];
[[NSNotificationCenter defaultCenter] postNotificationName:@"GPUImageMovieEndProcessing" object:nil];
NSLog(@"endProcessing");
}
if (synchronizedMovieWriter != nil)
{
[synchronizedMovieWriter setVideoInputReadyCallback:^{}];
[synchronizedMovieWriter setAudioInputReadyCallback:^{}];
}
}</pre></div></p>
<p>then in the view I'm playing the movie back I've just registered it to observe that NSNotification and set the selector to load the movie file again, with this at the top;</p>
<p><div class="geshifilter"><pre class="geshifilter-cocoa">if(movieFile) {
[movieFile removeAllTargets];
movieFile = nil;
}</pre></div></div></p>
pubDateSun, 25 Nov 2012 19:43:06 +0000dc:creator[email protected]guidfalsecomment 1696 at http://www.sunsetlakesoftware.comI have the video looping
http://www.sunsetlakesoftware.com/forum/looping-gpuimagemovie#comment-1619
<p>I have the video looping working really well.</p>
<p>In the <span class="geshifilter"><code class="cocoa geshifilter-cocoa">-(void)endProcessing</code></span> in GPUImageMovie.m i've added a simple NSNotificationCenter postNotification command to tell the system that the video has stopped processing;</p>
<p><div class="geshifilter"><pre class="geshifilter-cocoa">- (void)endProcessing;
{
for (id<GPUImageInput> currentTarget in targets)
{
[currentTarget endProcessing];
[[NSNotificationCenter defaultCenter] postNotificationName:@"GPUImageMovieEndProcessing" object:nil];
NSLog(@"endProcessing");
}
if (synchronizedMovieWriter != nil)
{
[synchronizedMovieWriter setVideoInputReadyCallback:^{}];
[synchronizedMovieWriter setAudioInputReadyCallback:^{}];
}
}</pre></div></p>
<p>then in the view I'm playing the movie back I've just registered it to observe that NSNotification and set the selector to load the movie file again, with this at the top;</p>
<p><div class="geshifilter"><pre class="geshifilter-cocoa">if(movieFile) {
[movieFile removeAllTargets];
movieFile = nil;
}</pre></div></p>
pubDateTue, 16 Oct 2012 09:54:09 +0000dc:creatordansinclair25guidfalsecomment 1619 at http://www.sunsetlakesoftware.comI just grabbed the latest
http://www.sunsetlakesoftware.com/forum/looping-gpuimagemovie#comment-1553
<p>I just grabbed the latest version from repository and the problem still exists.</p>
<p>Some more things I've found out about this. If the playback gets to the end and I call endProcessing and then recreate the GPUImageMovie after that everything works ok, so I don't crash, the dealloc method of the GPUImageMovie gets called as it should when I destroy the object.</p>
<p>However if I do endProcessing and try to destroy the GPUImageMovie and create a new one during processing/playback then I crash</p>
<p>So my guess is that weakSelf is holding on some objects in those blocks and the GPUImageMovie object is not allowed to die until that weakSelf lets go to whatever is holding on.</p>
pubDateTue, 14 Aug 2012 19:05:53 +0000dc:creatorHoratiuParguidfalsecomment 1553 at http://www.sunsetlakesoftware.comI don't think that this is
http://www.sunsetlakesoftware.com/forum/looping-gpuimagemovie#comment-1552
<p>I don't think that this is with the latest code. I'll grab it and will create an issue if it is still the case. Thanks!</p>
pubDateTue, 14 Aug 2012 18:41:20 +0000dc:creatorHoratiuParguidfalsecomment 1552 at http://www.sunsetlakesoftware.comIs this with the latest code
http://www.sunsetlakesoftware.com/forum/looping-gpuimagemovie#comment-1551
<p>Is this with the latest code from the repository? There was an -endProcessing bug that got fixed a few days ago, and I've just committed a significant rewrite of portions of the framework that include the movie sources.</p>
<p>If this still is happening with the current code, please create an issue for it on the GitHub page so that I can add it to my to-do list.</p>
pubDateTue, 14 Aug 2012 18:30:42 +0000dc:creatorBrad Larsonguidfalsecomment 1551 at http://www.sunsetlakesoftware.comHi Brad, first of all thank
http://www.sunsetlakesoftware.com/forum/looping-gpuimagemovie#comment-1550
<p>Hi Brad, first of all thank you for your response.</p>
<p>The test movie is : 960x540 and it has 22 seconds in length</p>
<p>For each of the filters I'm doing:</p>
<p> [_heatFilter forceProcessingAtSize:_regularOutputView.sizeInPixels];<br />
[_brightnessFilter forceProcessingAtSize:_regularOutputView.sizeInPixels];<br />
[_gammaFilter forceProcessingAtSizeRespectingAspectRatio:_regularOutputView.sizeInPixels];</p>
<p>The first time I load and run the movie it works as expected. When I try to remove the GPUImageMovie object and recreated it then it crashes.</p>
<p>It seems that the GPUImageMovie doesn't endProcessing. Also I've put a NSLog in the dealloc method of GPUImageMovie and this never gets called.</p>
<p>Thanks again for your help and hopefully you can figure out more then me to help me sort things out.</p>
pubDateTue, 14 Aug 2012 18:23:48 +0000dc:creatorHoratiuParguidfalsecomment 1550 at http://www.sunsetlakesoftware.comHow large is this movie?
http://www.sunsetlakesoftware.com/forum/looping-gpuimagemovie#comment-1548
<p>How large is this movie? You're running three simultaneous filters on it, and each one will need a framebuffer the size of each movie frame. That can be quite a lot of memory for 720p or 1080p videos. You might want to consider using -forceProcessingAtSize: to reduce the size of the filters to only what will be used in your final output.</p>
pubDateTue, 14 Aug 2012 18:15:23 +0000dc:creatorBrad Larsonguidfalsecomment 1548 at http://www.sunsetlakesoftware.comHi, I'm having the same
http://www.sunsetlakesoftware.com/forum/looping-gpuimagemovie#comment-1547
<p>Hi, I'm having the same problem here, I start running the movie and add filters to it like this:</p>
<p>- (void) startRunningMovie {<br />
NSString *pathToMovie = [[NSBundle mainBundle] pathForResource:@"TestMovie" ofType:@"m4v"];<br />
unlink([pathToMovie UTF8String]);<br />
NSURL *movieURL = [NSURL fileURLWithPath:pathToMovie];</p>
<p> if(_movieFile) {<br />
[_movieFile endProcessing];<br />
[_movieFile removeAllTargets];<br />
_movieFile = nil;<br />
}<br />
_movieFile = [[GPUImageMovie alloc] initWithURL:movieURL];<br />
//_movieFile.runBenchmark = YES;<br />
[_movieFile addTarget:_gammaFilter];<br />
[_movieFile addTarget:_brightnessFilter];<br />
[_movieFile addTarget:_heatFilter];</p>
<p> [_movieFile startProcessing];</p>
<p> }</p>
<p>Then at some point I do this:</p>
<p>- (void) resetViewport {<br />
if(_movieFile) {<br />
[_movieFile endProcessing];<br />
[_movieFile removeAllTargets];<br />
_movieFile = nil;<br />
}<br />
}</p>
<p>Still when testing on device, after these steps startRunningMovie - > resetViewport -> startRunningMovie I'll crash with Received Memory Warning.</p>
<p>Any ideas why? Am I doing something wrong?</p>
<p>Any help will be highly appreciated.</p>
<p>Horatiu</p>
pubDateTue, 14 Aug 2012 17:40:48 +0000dc:creatorHoratiuParguidfalsecomment 1547 at http://www.sunsetlakesoftware.comUnfortunately, I don't know
http://www.sunsetlakesoftware.com/forum/looping-gpuimagemovie#comment-1462
<p>Unfortunately, I don't know of a good way to do this. Are you sure that you're releasing the movie instance properly? I know that others have done this for looping, and they've not run into these kinds of memory issues.</p>
pubDateMon, 25 Jun 2012 22:15:17 +0000dc:creatorBrad Larsonguidfalsecomment 1462 at http://www.sunsetlakesoftware.com