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
    Posts
  • #20292
    jackluke23
    Participant

    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 2 years, 4 months ago by Windell Oskay.
    #21581
    Windell Oskay
    Keymaster
    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:
     video.start();
    #21582
    jackluke23
    Participant

    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. 
    #21583
    jackluke23
    Participant

    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!
    Jack
    #21584
    Windell Oskay
    Keymaster

    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.

    #21585
    jackluke23
    Participant

    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(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 Windell
    Cheers 
    #21586
    Windell Oskay
    Keymaster

    I 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

    #21587
    Windell Oskay
    Keymaster

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

    #21588
    jackluke23
    Participant

    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.