Raspberry Pi ofVideoPlayer FullHD movie

what’s the exact size of your video? some sizes need some resizing in memory which could be making things really slow, if you are using some strange resolution try using exact full hd, 1920x1080

Hello Arturo,

all videos I’ve tried are exactly 1920x1080. Here is a screenshot of its properties:

Hello Arturo,

although all the videos I’ve tried are 1920x1080, I’ve seen something strange at the output of the OF app:

pi@raspberrypi:~/openFrameworks/examples/video/videoPlayerExample $ make RunRelease 
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl gtk+-3.0 
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): screenRect: 1920x1080
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): windowRect: 1920x1080
[notice ] ofAppEGLWindow: createSurface(): setting up EGL Display
[notice ] ofAppEGLWindow: createSurface(): EGL Display correctly set 0x1
[notice ] ofAppEGLWindow: createSurface(): no current renderer selected
[notice ] ofAppEGLWindow: createSurface(): GLES2 renderer detected
[notice ] ofAppEGLWindow: createSurface(): surface created correctly
[notice ] ofAppEGLWindow: createSurface(): API bound correctly
[notice ] ofAppEGLWindow: createSurface(): -----EGL-----
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION_MAJOR = 1
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION_MINOR = 4
[notice ] ofAppEGLWindow: createSurface(): EGL_CLIENT_APIS = OpenGL_ES OpenVG
[notice ] ofAppEGLWindow: createSurface(): EGL_VENDOR = Broadcom
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION = 1.4
[notice ] ofAppEGLWindow: createSurface(): EGL_EXTENSIONS = EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_vg_parent_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_lock_surface 
[notice ] ofAppEGLWindow: createSurface(): GL_RENDERER = VideoCore IV HW
[notice ] ofAppEGLWindow: createSurface(): GL_VERSION  = OpenGL ES 2.0
[notice ] ofAppEGLWindow: createSurface(): GL_VENDOR   = Broadcom
[notice ] ofAppEGLWindow: createSurface(): -------------
[notice ] ofAppEGLWindow: setupPeripherals(): peripheral setup complete
[notice ] ofAppEGLWindow: setupNativeUDev(): created udev object
[notice ] ofAppEGLWindow: setupMouse(): unabled to find mouse
[ error ] ofAppEGLWindow: setupMouse(): did not open mouse
[ error ] ofAppEGLWindow: setupMouse(): did not open mouse, mouse_fd < 0
[warning] ofAppEGLWindow: setupKeyboard(): unabled to find keyboard
[ error ] ofAppEGLWindow: setupKeyboard(): did not open keyboard
[ error ] ofAppEGLWindow: setupKeyboard(): did not open keyboard, keyboard_fd < 0
[notice ] ofAppEGLWindow: setupPeripherals(): native event setup complete
[warning] ofShader: GL_VERTEX_SHADER shader reports:
[warning] precision mediump float;
#define IN attribute
#define OUT varying
#define TEXTURE texture2D
uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform mat4 textureMatrix; uniform mat4 modelViewProjectionMatrix; uniform float usingTexture; uniform float usingColors; uniform vec4 globalColor; IN vec4 position; IN vec4 color; IN vec4 normal; IN vec2 texcoord; OUT vec4 colorVarying; OUT vec2 texCoordVarying; void main(){ gl_Position = modelViewProjectionMatrix * position; if(usingTexture>.5) texCoordVarying = (textureMatrix*vec4(texcoord.x,texcoord.y,0,1)).xy; if(usingColors>.5) colorVarying = color; else colorVarying = globalColor; }

[warning] ofShader: GL_FRAGMENT_SHADER shader reports:
[warning] precision mediump float;
#define IN varying
#define OUT
#define TEXTURE texture2D
#define FRAG_COLOR gl_FragColor
uniform sampler2D src_tex_unit0; uniform float usingTexture; uniform float bitmapText; IN vec4 colorVarying; IN vec2 texCoordVarying; void main(){ vec4 tex; if(usingTexture>.5){ tex = TEXTURE(src_tex_unit0, texCoordVarying); if(bitmapText>.5 && tex.a < 0.5){ discard; }else{ FRAG_COLOR = colorVarying*tex; } }else{ FRAG_COLOR = colorVarying; } }

[notice ] ofGstVideoUtils: allocating with 1920x1088 RGBA

Please, take a look at the last line, it is talking about “allocating with 1920x1088 RGBA”. Could this be the problem (as you stated in your last answer)?

that’s strange but usually the problem is with the width not the height, have you tried with the original video that comes with omx player?

I don’t know which video is coming with omxplayer… Do you mean Big_Bunny?


Hello again,

I’ve downloaded the original movie from: http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_h264.mov

anf the behaviour is exactly the same, I get the same “[notice ] ofGstVideoUtils: allocating with 1920x1088 RGBA” message and the performance is about 2fps…

Any clue?

PD: In my first posts I told that I was using a RPi 2, but I was wrong, I’m using an RPi 3, does it make any difference?

Hello again…

Does anybody have any clue about this poor performance with FullHD movies with ofVideoPlayer on a Raspberry Pi? Or at least, can anybody confirm that it should work?

Thak you!

WIth ofxOMXPlayer, 720p works much better if there is a texture or pixels being used - 1080p is much slower.

ofVideoPlayer on the RPI is likely enabling textures by default. You might have to set up a custom GST pipeline in order to use what ofxOMXPlayer calls “Direct mode” where 1080p performs better.

Hello jvcleave,

I really don’t know what a GST pipeline is (I can investigate…) but it looks like somebody has already had success in playing FullHD movies with ofVideoPlayer in a RPI without any change in the code (or at least this is what I understand from this topic answers…). It looks like there’s something wrong in my installation (or configuration), but I cannot determine what…

With respect to ofxOMXPlayer, I know you are the main developer, and at least in my case it looks like the player is working fine with FullHD videos in non textured mode, but it needs some kind of “warmup time” befre playing correctly. This “warmup time” is about 10 secons, and during this time the video suffers a lot of stuttering. After this time, everything plays very well and if you set the video to loop, then it also plays well although it is starting again (inside the loop). I don’t know if you can see where could be the problem of this behaviour, or at least, could you give me any clue on where to start searching in ofxOMXPlayer code to try to discover the problem (and if possible correct it)?

Thank you in advance.


is your raspberry firmware updated to last revision ?

Yes, I think so…

pi@raspberrypi:~ $ /opt/vc/bin/vcgencmd version
Apr 27 2017 17:19:34
Copyright (c) 2012 Broadcom
version 17af5814bb19dbb7c70ccd2c845b80a160943811 (clean) (release)
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l GNU/Linux

hey just to say that although 2fps seems really slow for me for 1 fullHD video i haven’t really tried it and it’s a long time since i don’t use the PI so it might be that it’s just like that, all the tests i asked you to do look correct, gstreamer is using omx…

the only thing i could imagine that it’s left to try is to use archlinux instead of raspbian, the gstreamer plugins there are more up to date there, if i remember well the ones in raspbian even had a memory leak (might be fixed already)

archlinux is also compiled for armv7 instead of 6 with neon optimizations if i remember well so certain operations might be also faster because of that.

if the fps is really 2fps i doubt switching to arch linux is going to make a huge difference but it might be worth trying to see if there’s any difference

you can be sure you are on the latest firmware version by launching rpi-update

also check if :

  • you are using the experimental GPU driver ?
  • did you boost GPU memory ?

I did a lot of ofOmxPlayer stuff and experienced some really strange behaviour tracked down to these sources of error:

  • Which SD cards do you use? Use fast ones from well known manufacturers. Maybe search for a compatibility list.
    I can recommend SanDisk Ultra Class 10.

  • Also make sure your powersupply can provide enough power. Don’t go for the cheap ones. Your RPI3 needs a powerful one (at least 3000 mA). Double check you have the debug messages (rainbow logo) activated.

  • Don’t overclock

  • Use a metal case, or for testing no case at all

  • Make sure you know your codecs, bitrates, and containers. Not all encoders do the same things with the same preferences. The mentioned “warm up stutter problem” sound like something i also had with full hd h264 mp4 files rendered from aftereffects. I had no problems with files rendered from final cut with the exact same preferences. I made best experiences with fullHd mov h264 and bitrates <10000.

Hello, I’ve tried many things:

  • Used rpi-update to update the firmware to the latest.
  • Set the GPU memory to 256Mb.
  • Used RPi official power supply.
  • Used official class 10 16Gb micro SD.
  • Tried enabling and disabling the experimental GL driver.
  • Run OF inside and outside the X desktop

and some other things, and with all of them I get exactly the same result (or no result).

So, I’ve given up trying to use ofVideoPlayer and ofOmxPlayer to play FullHD videos. I think I’ll go for another approach and use (command line) omxplayer within a thread to play videos, because all videos I’ve tried are working properly with omxplayer and none of them work with any of the OF alternatives.

Anyway, thank you all for your help.

Best regards.

Hi jordiblanchcarles,

sorry for you that it did not work with ofVideoPlayer. I did also fail, although some time ago. What I do not understand is:
You give up ofxOmxPlayer also? It might have some codecs with problems (see my posts) but I can assure you it works stable and quick - and I could also help with it if necessary. But you wrote you did try it also (you did not explain in the post)?

have a good day!

Hello dasoe,

thank you for your answer. I was trying ofVideoPlayer because it has the “loadAsync” method that I’d like to use (and ofxOMXPlayer does not have), and also because I was having problems with stuttering at the beginning of the videos when using ofxOMXPlayer. I know there’s people around that has succeeded playing fullHD videos with it, but I want my program to be able to play videos created from different sources/people, and such restrictions on codecs and bitrates would make it a nightmare trying to check/convert every video to a specific configuration. So these are the 2 main reasons I just discarded ofxOMXPlayer. But now I have another idea on how to use ofxOMXPlayer that’s based on a conversion step prior to playing the videos (only once per video, of course). Do you have or know about any ffmpeg conversion parameters that convert any video to anther one suitable to be played correctly with ofxOMXPlayer?

Thank you!

Yes I do, (see also Video stutters when loop starts). This one works with no stuttering for me:

-vcodec libx264 -profile:v baseline -preset:v slow -level 3.1 -refs 2 -coder 0

have a good day!

Perfect! I’ll try it!

Thank you!