DestroAnt
Posts: 1
Joined: Mon Feb 16, 2015 11:56 pm

Raspivid stream to a java panel questions

Tue Feb 17, 2015 12:09 am

Hello,

I am making a photo booth type application using the java swing framework and the raspberry pi camera module. I want to have a preview from raspivid visible to the user so they can preview the picture before taking it embedded into a java application.

I have been struggling to try and find a good method to have the java panel display the feed from raspivid. I keep finding bits and pieces of what to do but i see no clear way to do this in an efficient and quick manner.

From what I understand, I think have to do the following

-Exec raspivid (With possible the -o param)
-Use a media framework, such as jvlc

I am just struggling putting the pieces together. I know raspvid can stream to stdout (using the -o arg), but i'm not sure how to use jvlc to see that stream (if it is at all possible).
I know that jvlc can play media files in a panel, but i'm not sure if it can do it while the file is being written or if you can play it from a stream.

I am just unsure on how to go about this issue in a neat efficient way for the pi. I'm just wondering if anyone has done anything similar and has any pointers/suggestions on how I would go about doing this.

Thanks,

User avatar
clicky
Posts: 499
Joined: Thu Oct 25, 2012 7:34 am

Re: Raspivid stream to a java panel questions

Tue Feb 17, 2015 4:35 pm

Definitively interesting question.

No answers - nor time to find time (sorry O: ), but I do have more questions: did you try to pass/wrap/adapt System.in for jvlc - so it reads it instead of a file?

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Raspivid stream to a java panel questions

Tue Feb 17, 2015 5:01 pm

1) On a RPi2 , you might try loading the official V4L2 driver
and then using anything that supports V4L2 webcams under
Java.

2) On an older Raspberry you either have to wrestle with
the mess that is OpenMAX IL through projects like JogAMP or
call both omxplayer and raspicam and find a way to
resize / move omxplayer output over the screen (this
works successfully for omxplayerGUI , for example).

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Return to “Java”