Peggy 2 Video stream (webcam)

Home Evil Mad Scientist Forums LED Matrix Kits Peggy 2 Video stream (webcam)

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #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, Jack
    This 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 3 years, 5 months ago by Windell Oskay.
    Windell Oskay
    This 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:


    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. 

    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!
    Windell Oskay

    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.


    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.AppAPI
    at org.gstreamer.elements.AppSink.gst(
    at org.gstreamer.elements.AppSink.pullBuffer(
    at org.gstreamer.elements.RGBDataAppSink$AppSinkNewBufferListener.newBuffer(
    at org.gstreamer.elements.AppSink$2.callback(
    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(
    at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(
    Not sure what gstreamer is….
    Thanks again for your help Windell
    Windell Oskay

    I am not otherwise familiar with the issue, but found this discussion online, that might be helpful:

    Windell Oskay

    You said in the other thread that you had this working now.  Do you know what the problem turned out to be?


    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. 
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.