Hi, guys.
Is there any trick to speed up Pi3 working with 2D graphic or video?
For one project I need to display several PNGs with alpha blending on 1920x1080 resolution,
for other — play short (less than a minute) 1080p video with short live cam insert.
In both situations, framerate is very low, up to 3-4 fps.
I have tried *ofFbo instances for buffering, but it really doesn’t help.
interface->begin();
ofClear(0, 255);
ofEnableAlphaBlending();
… draw pngs and some interactive objects between them
interface->end();
ofDisableAlphaBlending();
interface->draw(0, 0);
Is there any ticks or hint or Raspberries (even 3rd generation) are not so cool?
For example, on Macbook everything runs smoothly with framerate above 60.
gllmar
June 29, 2016, 8:04pm
#2
Hi,
How many png are overlayed?
How much memory did you allocate to GPU using raspi-config
?
For video playback using ofxOMXPlayer is a key to achieve 1080p video playback with appropriate h264 encoding.
For video grabbing, if you are using the raspberry pi camera, the add-on ofxRPiCameraVideoGrabber get decent fps.
Hope it help!
Hi, thanks for video/cam hints.
Three full scale PNG’s (1920x1080) and some minor elements.
On Mac it runs over 60 fps without any problem.
gllmar
June 29, 2016, 8:37pm
#4
Try to deactivate parts of your code to see where the latency happens.
For instance, run only the png overlay and check the fps
then run only the camera and check the fps.
Look also at your cpu usage using something like top
in the terminal / ssh
Hope you can sort it out, the rpi3 should be handle this task.
PNGs and video/camera thing are two different projects.
I have tried to ‘comment’ some parts for the former, but without any significant results.
Gonna try to distribute tasks to all cores (ofThreads).
Hi, gllmar!
I have found problem in my first code. Have missed that there is a soundtrack behind the scene, so it was the main issue.
Is there similar add-on as ofxOMXPlayer to accelerate audio or I could easily use OMX?
gllmar
July 1, 2016, 11:03pm
#7
How do you accomplish the playback of the sound?
In what kind of format it is? What is the length of the file?
Audio playback doesn’t need to be accelerate by the Gpu.
If it is only audio playback, it is a light task that the cpu should handle it correctly.
The example locate in openFrameworks/examples/sound/soundPlayerExample cover the basics of sound playback if you ever need it for references.