I have made a stripped down version of the VideoPlayerExample on Raspberry Pi to experiment with performance of video playback. I’m making a VJ app.
Raspberry Pi Model B2.
Wheezy 3.18.5+.
Current OpenFrameworks.
The code is stripped right down. I’ve removed all the UI stuff. I’m drawing to a 500x500 surface. I’m using my own movie file. I’m running this in single user mode.
Sometimes I’m getting a “cannot get pipeline caps” error.
Sometimes I’m getting a repeating error to do with “preroll”.
Sometimes I’m getting just a system freeze, before or after the background draws.
Sometimes it works!!
Short of fully understanding the problem, I’m wondering if anyone can suggest workarounds or some error reporting tricks that would help me build a system that is robust and predictable.
Thanks Asper, but the absolutely essential part of my project is precise varispeed control. I haven’t tried OMXPlayer out properly yet but I understand that you cannot set speed to an arbitrary float, only increments of 0.5x.
Although the ofVideoPlayer is implemented in an inefficient way, playing a video at a certain speed is all I need to do, and I have seen that it can do this. In my tests, when it works it works very well.
there’s lots of fixes to the linux video player in OF master in github if you are not using that. also in terms of performance the main problem with the current video player is not being hw accelerated, which it is, but that the colorspace conversion is done in the cpu. in master you can also avoid that by doing:
no, it shouldn’t. i think i fixed something like what you describe for gstreamer 1.4 that wasn’t happening in 1.2 but not sure wheezy is already on 1.4
@arturo the videoPlayer example runs great on rpi2 with setPixelFormat(OF_PIXELS_NATIVE)- thanks for the tip. Only issue is the video is black and white (tested with multiple videos)- any ideas?
OF_PIXELS_NATIVE makes the video pipeline return the native format of the video or camera which is usually some YUV format avoiding the colorspace conversion in the CPU which is usually quite expensive. OF when using the default renderer only shows the first YUV plane which is Y the lunminance so you only see a black and white image. if you change to the programable renderer changing main to:
@arturo thank you. HD video runs smooth (and full colour) at 60fps with GLES2. Also seeking/scrubbing with setPosition() is finally bearable (less than 50ms).
@arturo I just hit another wall with the new gst video player- the app freezes when using setPosition() intermittently (maybe 1 in 10 calls) and I have to force quit. It doesn’t seem to be memory/ram related (i have 384mb split for video memory as suggested by Jason).
I’m syncing video across 6x rpi2’s, and it’s almost there. I could switch back to omx, but the delay when seeking is too large and I can’t get perfect sync. @jvcleave if there is a way around this- i’d love to know.
and I am getting a completely blank window. Event native openFrameworks draw functions do not work. I have Gstremer 1.4.4-2. Although gstreamer1.0=omx is at version 1.0.0.1-0+rpi18rpi1g Could that be the problem?
I’m searching for this solution, I’ve been trying ofxOMXPlayer but it doesn’t compile in of_10 anymore.
That code change is applicable to of_v11 in raspbian-buster?