Playing a filtered video at normal speed

5 replies [Last post]
dimi2012
User offline. Last seen 8 years 45 weeks ago. Offline
Joined: 07/04/2012
Posts:

I have a movie file, which I would like to filter and play simultaneously, without re-encoding to a new movie file.

I do this by adding a filter target to the movie file, adding a view target to the filter, and then calling [movieFile startProcessing].

The problem is that the playback happens at about double the speed of the movie, I'm assuming because that's the speed the movie file is processed at. Is there a way to slow this down to get a filtered playback without having to re-encode?

Thanks!

Brad Larson
Brad Larson's picture
User offline. Last seen 4 years 22 weeks ago. Offline
Joined: 05/14/2008
Posts:

Not right now. The movie playback support is very crude, and doesn't respect the framerate of the original movie. The movie reader would need to have some logic added to delay each frame to match their frame times, but nothing like that is in there.

You're welcome to help add it in, if you'd like. I honestly haven't spent much time with the movie handling code.

dimi2012
User offline. Last seen 8 years 45 weeks ago. Offline
Joined: 07/04/2012
Posts:

Cool, thanks. I'll give it a try.

fcasado
User offline. Last seen 8 years 45 weeks ago. Offline
Joined: 07/18/2012
Posts:

Hi,
I have exactly the same need, and I also need to play sound.
I'm not sure that a good sync can be handled by some sleep in a loop.
I've just see that you have created a GPUImageUIElement source class that can be initialized from a CALayer. Do you think that using a AVPlayer, (which is supposed to be sync with actual video frame rate and keeping sync with sound) and the GPUImageUIElement class, is this a way to get this feature?

Actually, I just started objective C 3 days ago and got my first mac OS 1 week ago, so I can give a hand with some directives, but like this, I confess I'm a little bit lost.

Brad Larson
Brad Larson's picture
User offline. Last seen 4 years 22 weeks ago. Offline
Joined: 05/14/2008
Posts:

No, if you look at what the GPUImageUIElement input does, it has to rasterize the UI elements via Core Graphics for each frame, which is a very slow process. It also won't work with an AVPlayer, since an AVPlayer can't be captured in that manner.

Some sort of frame timing on the movie input side will be required in order for playback to occur at the correct speed.

Flow
User offline. Last seen 8 years 32 weeks ago. Offline
Joined: 10/09/2012
Posts:

Hi Brad,

How complex to implement the "movie playback with filters without saving to disk" function in your framework? Any directions on doing this?

Syndicate content