GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

Problems with my own video

Open pgodino opened this issue 14 years ago • 6 comments

I have a sequence of image I convert to a video with Apple compressor using the iOS device template. I'm able to play the resulting video with finder without any problem. When I try to play the video with GPUImage it is completely deformed, I can see just diagonal lines.

Can you suggest me the right format/the best tool I can use to create the video from a PNG image sequence?

pgodino avatar Aug 27 '12 13:08 pgodino

I solved this problem. Ass suggested here http://stackoverflow.com/questions/7620490/playing-video-on-ios-using-opengl-es I changed the line

int bufferWidth = CVPixelBufferGetWidth(movieFrame);

in GPUImageMovie.m / processMovieFrame with

int bufferWidth = CVPixelBufferGetBytesPerRow(movieFrame) / 4;

In this way both my own video and the sample video are played well.

pgodino avatar Aug 28 '12 08:08 pgodino

Just a little update. The problem appeared only on the simulator. On real devices the original code works perfectly.

pgodino avatar Aug 28 '12 08:08 pgodino

Interesting. I saw something similar to this with certain camera frame sizes when taking photos with the texture caches, so I can see why the above might fix it. I assume this replaces the matching line in GPUImageMovie, correct?

If so, I'll change that code for the next commit.

BradLarson avatar Aug 28 '12 14:08 BradLarson

Yes it is correct. Anyway as I wrote, the problem is actually only on the simulator. On actual device your original code works fine (and mine does not work). So the best it is maybe to use an

#if TARGET_IPHONE_SIMULATOR

to use one line of code or the other.

pgodino avatar Aug 28 '12 14:08 pgodino

That's odd. It might be a bug in the Simulator then. I'll add the conditional compilation check for that. What version of the Simulator did you see this under?

BradLarson avatar Aug 28 '12 15:08 BradLarson

Yes really strange. Both with 5.1 included in XCode 4.4.1 and 6.0 included in XCode 4.5 beta 4. I thought that could be encoding problem but I use Apple Compressor with iOS devices template. Video exported for example from flash does not have the problem.

pgodino avatar Aug 28 '12 15:08 pgodino