ofVideoPlayer oF 0.06 - linux : video formats?


I’ve been running some tests on ofVideoPlayer, running OF 0.06 on Ubuntu Hardy.

The main purpose of this post is to ask about the experiences other Linux users might have had with different video formats, and if anybody has successfully provided negative speeds to ofVideoPlayer.

An overall problem I’ve found is that I can’t set any negative speeds, the videos stay paused with negative values. In 0.05 ofVideoPlayer works well with negative speeds, playing backwards as one would expect. However, in 0.06 I haven’t been able to play backwards, even with the default movieExample .

Other than that, the default example works OK, but I’ve been having trouble running other file types, such as .mpg or .avi, specially with the setSpeed() method; until now the only format that has worked well for me is .mov.

Other than .mov files, I was (a bit) successful with .mpg files; being able to perform .setPosition(). however, everytime I change the position, there is a short pause, around 100 ms, but still enough to be noticed. With .avi files, I wasn’t able to perform either .setPosition() nor .setSpeed.

So, I’m thinking I’m going to stick to .mov files for now, even when I don’t really like to convert my .mpg files to .mov

Thanks a lot for your attention,


Hey rodrigo

yes you can have problems with seeking and changing speed, mainly with negative speeds. The previous library we used in 005 was really problematic and slooow so in 006 we are using gstreamer which is faster and support things like sound but can have this problems with some formats.

It can be useful if you can post about the exact formats you are having trouble with, just right click the file and look at the properties, there it should tell the encoding of the file.



Hey, just a quick side note: If you are using gstreamer, then you’re obviously going to have to apt-get (or otherwise install) the gstreamer plugins for the movie type you are using.

yes, if they’re not installed the app will fail to open the file and show an error in the console telling the format is not known. in most distributions you just need to open the video with the default video player, in gnome usually totem and it will install the codec for you.

tried to do this from the same openframeworks but it’s distribution specific and needed to include some additional libraries in the projects

Hey @arturo - is setSpeed() with negative values still an issue with gstreamer?

Negative speeds definitely work with the H.264 fingermovie example, but when i load an animation-codec file instead of fingers.mov, it crashes as soon as it tries to set a negative speed. (In my own app, setting a negative speed on the same video, causes the video to freeze on the current frame. So the crash might be due to other issues.)

Depending on the size of the video you can always load the frames into RAM. That’s the best way to guarantee butter smooth scrubbing back and forth, although obviously not ideal for large files.

Is there another way of loading videos into RAM besides ofVideoPlayer.loadMovie() ? And then scrub with setFrame() ?

Of H264 (mp4), raw, animation, photoJPEG (all mov) only H264 seems to be able to play backwards. All the movs freeze on the frame.

Not sure, maybe try encoding with ffmpeg/mencoder and see if that helps.

When I say loading into RAM I mean stepping through the video file and calling videoplayer.update() and videoplayer.getpixels() to extract the frames into a vector or array, then playing these back at what ever framerate you need. They are then stored as images in RAM with light compression, as opposed to reading from disk and therefore much faster.

negative speeds should work, but this depends greatly on the format, mostly if it has enough keyframes. as grimus says try encoding the file with ffmpeg or some ffmpeg based software since that’s what gstreamer use internally to decode videos, and add as many keyframes as posible, if you don’t have hd limitation/speed problems some raw format that is just the video frame by frame would be the best