February 3, 2014 at 5:22 pm #20292
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.
February 3, 2014 at 5:39 pm #21581This is due to a change in the video library since we last updated the Peggy 2 library.Find the line that says:
- This topic was modified 2 years, 4 months ago by Windell Oskay.
video = new Capture(this, 320, 240, 15); //Last number is frames per secondAnd, after that line, add the following:video.start();February 3, 2014 at 6:25 pm #21582
Bingo!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 #21583
Also, 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 #21584
Yes, 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 #21585
Ok 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 #21586
I am not otherwise familiar with the issue, but found this discussion online, that might be helpful:February 27, 2014 at 1:37 pm #21587
You 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 #21588
Yes, 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.
- You must be logged in to reply to this topic.