iyosch
Posts: 19
Joined: Tue Jun 09, 2015 6:40 am
Location: Jakarta, Indonesia

How to show raspicam preview on java application?

Wed Jul 01, 2015 3:27 am

I have tried for almost a week to find the solution. Along the way I found out that we can't show raspicam preview or even play video on
a touch screen display. (My project forced me to use an LCD display, I use lcd touchscreen 3.5" from waveshare, also custom Raspbian OS
from waveshare). I have found out how to display screen from HDMI to lcd touchscreen or display fb0 to fb1 using fbcp. The link is :
https://github.com/tasanakorn/rpi-fbcp . It has some flaws, the method is to copy the framebuffer from fb0 to fb1. So everything that is
shown on the HDMI or fb0 will be shown on fb1 or touchscreen display. With this, I manage to play video and show raspicam preview to lcd
touchscreen since it is also being played on HDMI or fb0. The problem is I must show the raspicam preview into my java application on
Raspberry using touchscreen display. Another method that I have tried is using uv4l driver, but it only allows me to control the camera
using the driver while we can control the camera using command raspistill -p 10,10,10,10 -o <picname.jpg>. If anyone knows how to directly
access the raspicam preview and send it realtime to my java application that would solve the problem. Thank you.

Return to “Graphics, sound and multimedia”