GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

Video is played too fast

Open pgodino opened this issue 14 years ago • 2 comments

I tooked the example SampleVideoFileFilter and I removed the peace of code responsible for writing the video file because it is not needed. In this way the video included in the example is played at increased speed. Am I doing something wrong?

pgodino avatar Aug 27 '12 13:08 pgodino

Yes, I currently do not account for the source framerate of movies being played back at all. This leads to the faster than intended playback you see. I welcome any contributions that fix this, because I don't spend any time with movie playback myself.

BradLarson avatar Aug 27 '12 14:08 BradLarson

As a workaround I put an [NSThread sleepForTimeInterval:1.0/((AVAssetTrack*)[[self.asset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]).nominalFrameRate];

on the while loop in GPUImageMovie.m / processAsset.

For sure it is not the best solution but I tried also on slower devices and I didn't notice great performance issues.

pgodino avatar Aug 28 '12 14:08 pgodino