jvcleave / ofxOMXPlayer

OpenMax accelerated video player for openFrameworks on the Raspberry Pi 0-3. Does not work with RPI4
GNU General Public License v2.0
180 stars 61 forks source link

draw rectangle without texture mode #134

Closed micha1pu closed 6 years ago

micha1pu commented 6 years ago

Is it possible to draw in direct video mode? Omxplayer can set video render layer number via --layer. When I run sketch with direct video mode I can see for 0.5s "bottom" layer with my rectangle, but rectangle is being overdraw by video. Texture mode is not fast for 1080p video.

jvcleave commented 6 years ago

There is an omxPlayer.setLayerbut I haven't tested it much

Yeah - As mentioned in the Readme, texture mode works best at 720p

micha1pu commented 6 years ago

I'm getting Segmentation fault when omxPlayer.setLayer(1) in setup. But anyway i don't think it will force video layer to bottom and OF will draw on top of it, they will be still on same layer i think.

jvcleave commented 6 years ago

the layer property is probably something that should be passed via settings to make sure the player is ready to accept it. in the meantime you should be able to set it in draw() to avoid the exception

I was messing with it a bit and was able to change it but had to tweak the window settings in order to layer things properly. I'll post an example once I get some things worked out

jvcleave commented 6 years ago

I added a layer option to ofxOMXPlayerSettings and example-direct-mode-advanced

I put everything in one file as it is important to see the window setup code in main()

This also requires a mod to OF so see the note

micha1pu commented 6 years ago

It's working perfectly, thank you.

timonsku commented 6 years ago

that's really great!