Home › Evil Mad Scientist Forums › LED Matrix Kits › Peggy 2 Video stream (webcam)
- This topic has 8 replies, 2 voices, and was last updated 10 years, 10 months ago by jackluke23.
-
AuthorPosts
-
February 3, 2014 at 5:22 pm #20292jackluke23Participant
Hey everyone,
Im hoping someone can help me, I have completed my Peggy 2 and delighted with the outcome, its brilliant! But im in the process of trying to connect it to my webcam on my laptop. I have soldered the two jumpers into the ‘SER’ area on the PCB. The peggy works great and i have not had one problem yet. I have the Arduino and Processing software and have installed the Peggy 2 serial library for Arduino.I uploaded the recieve sketch to the peggy. Then in processing i ran the mirror peggy sketch.This is where my problem is. After i change the comm port in the code and click run, the webcam window pops up, but its black. Nothing but black!The small indication light next to the webcam doesn’t turn on either.But, when i run a different video sketch in the processing library, it works fine. Webcam window pops up and i can see myself.Not sure where i went wrong. Fairly new to this stuff so i apologize in advance :)Any help/ comments would be great! Iv included some snaps!Thanks, JackThis Pic shows the mirror peggy sketch only showing a black window :(This pic shows the example mirror sketch and my webcam working.- This topic was modified 6 years, 7 months ago by Windell Oskay.
February 3, 2014 at 5:39 pm #21581Windell OskayKeymasterThis is due to a change in the video library since we last updated the Peggy 2 library.Find the line that says:video = new Capture(this, 320, 240, 15); //Last number is frames per second
And, after that line, add the following:video.start();February 3, 2014 at 6:25 pm #21582jackluke23ParticipantBingo!
Thanks Windell!It gave me an error at first..”the requested resolution of 320×240,15/1fps is not supported by the selected capture device”Does that mean i need a better camera? I changed 15 to 10 and it worked. Would have liked 15 though.February 5, 2014 at 2:27 pm #21583jackluke23ParticipantAlso, i was wondering if it would be possible to play a video/ mp4 onto the peggy? i presume editing some of the mirrorpeggy code would be necessary. Prehaps replace the ‘capture video;’ line with something else relating to the directory of the mp4?
Thanks a million for your help!JackFebruary 5, 2014 at 3:00 pm #21584Windell OskayKeymasterYes, it is quite possible to change the video source to take video from a file. I think that a few people have already done this, but I do not have example code for it at this time.
February 6, 2014 at 8:43 am #21585jackluke23ParticipantOk thanks, i’ll check out the other topics in the forums.
Unfortunatly iv come across another problem, the black screen is back, and it wont stream to the peggy, this is the error im getting. As far as i know i havnt changed anything…JNA: Callback org.gstreamer.elements.AppSink$2@47c988f threw the following exception:java.lang.NoClassDefFoundError: Could not initialize class org.gstreamer.lowlevel.AppAPIat org.gstreamer.elements.AppSink.gst(AppSink.java:38)at org.gstreamer.elements.AppSink.pullBuffer(AppSink.java:128)at org.gstreamer.elements.RGBDataAppSink$AppSinkNewBufferListener.newBuffer(RGBDataAppSink.java:144)at org.gstreamer.elements.AppSink$2.callback(AppSink.java:184)at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:455)at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:485)Not sure what gstreamer is….Thanks again for your help WindellCheersFebruary 7, 2014 at 1:31 pm #21586Windell OskayKeymasterI am not otherwise familiar with the issue, but found this discussion online, that might be helpful:
http://forum.processing.org/two/discussion/2716/windows-8-video-capture-issue/p1
February 27, 2014 at 1:37 pm #21587Windell OskayKeymasterYou said in the other thread that you had this working now. Do you know what the problem turned out to be?
February 27, 2014 at 2:13 pm #21588jackluke23ParticipantYes, there is a bug with the processing version 2.1.1 video library on windows. It wont be fixed until version 2.1.2.
I just reinstalled 2.1.0 and it worked. -
AuthorPosts
- You must be logged in to reply to this topic.