GPUImageMovieWriter cuts off prematurely for short videos #1403

Open
mobitar opened this Issue Feb 5, 2014 · 4 comments

Comments

Projects
None yet
4 participants
@mobitar

mobitar commented Feb 5, 2014

I've noticed an issue where trying to write a movie with a duration of anything < 0.5 seconds causes the writer to output a blank and possibly corrupted file.

(I've also noticed that around 0.5 seconds is cut off from the end of any long video as well.)

I'm using the same exact code as from the SimpleVideoFileFilter to write the movie.

Changing the completion block from:

[movieWriter setCompletionBlock:^{
        [filter removeTarget:movieWriter];
        [movieWriter finishRecording];
    }];

to:

[movieWriter setCompletionBlock:^{
        double delayInSeconds = 1.0;
        dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
        dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
             [filter removeTarget:movieWriter];
             [movieWriter finishRecording];
        });
}];

solves this issue, but is only a hacky workaround. Any idea what the underlying problem is?

@truelson

This comment has been minimized.

Show comment
Hide comment
@truelson

truelson Mar 9, 2014

Seeing the exact same thing...

truelson commented Mar 9, 2014

Seeing the exact same thing...

@truelson

This comment has been minimized.

Show comment
Hide comment
@truelson

truelson Mar 10, 2014

Actually, figure it's worth seeing if it's hardware related as other people should be seeing this and it's pretty easy to repro. I've seen the .5 seconds cut off on both an iPhone 4s and an iPhone 5s... only recently have noticed the .5 second file corruption, but that was due to the first time using a .5 second long file.

Actually, figure it's worth seeing if it's hardware related as other people should be seeing this and it's pretty easy to repro. I've seen the .5 seconds cut off on both an iPhone 4s and an iPhone 5s... only recently have noticed the .5 second file corruption, but that was due to the first time using a .5 second long file.

@finbarr

This comment has been minimized.

Show comment
Hide comment
@finbarr

finbarr Jun 27, 2014

+1 this is happening sporadically when I write videos using GPUImageMovieWriter.

finbarr commented Jun 27, 2014

+1 this is happening sporadically when I write videos using GPUImageMovieWriter.

@tuo tuo referenced this issue Feb 5, 2015

Closed

Fix movie writer #1913

@rgmvisser

This comment has been minimized.

Show comment
Hide comment
@rgmvisser

rgmvisser May 30, 2015

+1 same here, significant time loss with small movies..

+1 same here, significant time loss with small movies..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment