Overlaying an image using OMXPlayer and numpy array
An image can be overlayed a video played with OMXPlayer if omxiv renders the image in a higher level than OMXPlayer.
If OMXPlayer renders the video in level -128 and I write the image as a numpy array direct to the framebuffer (level -127), I had expexted an overlayed image, but no image is visible, only the video.
What is wrong here?
If OMXPlayer renders the video in level -128 and I write the image as a numpy array direct to the framebuffer (level -127), I had expexted an overlayed image, but no image is visible, only the video.
Code: Select all
fb = numpy.memmap('/dev/fb0', dtype='uint8',mode='w+', shape=(1080,1920,4))
fb[:] = numpy.array(img)Re: Overlaying an image using OMXPlayer and numpy array
Two immediate hints I can give:
- While both programs are running, run „vcgencmd dispmanx_list" in a third terminal. It will show active layers and you should see both layers if you configured everything correctly.
- If you only see one layer, maybe omxplayer is configured to exclusively use the output. I’m on mobile at the moment, but there are multiple options to adjust the output layer and related settings.
info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted
Re: Overlaying an image using OMXPlayer and numpy array
The output of `vcgencmd dispmanx_list` shows that my image is not written to the framebuffer::
Code: Select all
display:2 format:YUV_UV transform:0 layer:-128 1280x720 src:0,0,1280,720 dst:0,0,1920,1080 cost:1216 lbm:20480 (ignore lower layers)
display:2 format:UNKNOWN transform:100000 layer:-127 0x0 src:0,0,1920,253 dst:0,780,1920,253 cost:0 lbm:0
Jump to
- Community
- General discussion
- Announcements
- Other languages
- Deutsch
- Español
- Français
- Italiano
- Nederlands
- 日本語
- Polski
- Português
- Русский
- Türkçe
- User groups and events
- Raspberry Pi Official Magazine
- Using the Raspberry Pi
- Beginners
- Troubleshooting
- Advanced users
- Assistive technology and accessibility
- Education
- Picademy
- Teaching and learning resources
- Staffroom, classroom and projects
- Astro Pi
- Mathematica
- High Altitude Balloon
- Weather station
- Programming
- C/C++
- Java
- Python
- Scratch
- Other programming languages
- Windows 10 for IoT
- Wolfram Language
- Bare metal, Assembly language
- Graphics programming
- OpenGLES
- OpenVG
- OpenMAX
- General programming discussion
- Projects
- Networking and servers
- Automation, sensing and robotics
- Graphics, sound and multimedia
- Other projects
- Media centres
- Gaming
- AIY Projects
- Hardware and peripherals
- Camera board
- Compute Module
- Official Display
- HATs and other add-ons
- Device Tree
- Interfacing (DSI, CSI, I2C, etc.)
- Keyboard computers (400, 500, 500+)
- Raspberry Pi Pico
- General
- SDK
- MicroPython
- Other RP2040 boards
- Zephyr
- Rust
- AI Accelerator
- AI Camera - IMX500
- Hailo
- Software
- Raspberry Pi OS
- Raspberry Pi Connect
- Raspberry Pi Desktop for PC and Mac
- Beta testing
- Other
- Android
- Debian
- FreeBSD
- Gentoo
- Linux Kernel
- NetBSD
- openSUSE
- Plan 9
- Puppy
- Arch
- Pidora / Fedora
- RISCOS
- Ubuntu
- Ye Olde Pi Shoppe
- For sale
- Wanted
- Off topic
- Off topic discussion