Processing.video library gives v4l2src error

I am interested in using the processing-video library for my project, but I think I hit a brick wall. I tried running the CustomPipeline example given that i’m trying to display a custom stream of an IP camera.

This is the error message I’m getting:

“IllegalArgumentException: No such Gstreamer factory: v4l2src”

This is the example code:

/**
 * CustomPipeline 
 * by Andres Colubri. 
 * 
 * Create a Capture object with a pipeline description to 
 * get video from non-standard sources.
 */

import processing.video.*;

Capture cam;

void setup() {
  size(640, 480);
  
  // Start the pipeline description with the "pipeline:" prefix, 
  // the rest could any regular GStreamer pipeline as passed to gst-launch:
  // https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html?gi-language=c#pipeline-description 
  cam = new Capture(this, 640, 480, "pipeline:videotestsrc");
  cam.start();  
}

void draw() {
  if (cam.available() == true) {
    cam.read();
  }
  image(cam, 0, 0, width, height);
}

I am using a Raspberry Pi 4 and have installed gstreamer1.0. I have even tried to display a stream from the command line and it has worked, so I don’t think it’s an installation issue. I have found a few threads on google that explore this problem. Most of them are from 4-5 years ago though, and use gstreamer0.1 instead of gstreamer1.0 and an old processing.video library. The current version of the library (correct me if I’m wrong) should support gstreamer1.0 and is suposed to be a pretty smooth operation.

Anyone have any ideas on what the issue might be? Thank you!!

1 Like

I have a RaspberryPi4 but not processing ide installed, instead I use PiCrate (ruby implementation of processing) and this is what I get (no video device attached).


Are you using https://github.com/processing/processing-video/releases/tag/r6-v2.0-beta4, if not you should be. Console output Processing video library using GStreamer 1.14.4.

1 Like

I replaced my version of the library with the one you mentioned, and it worked! Thank you! Now I have the problem of actually getting my pipeline to work. This is the what I’m sending gst-launch through the command line: udpsrc port=5001 ! application/x-rtp,encoding-name=JPEG,payload=26 ! rtpjpegdepay ! jpegdec ! autovideosink

I’m adding this line right after the "pipeline:" prefix but I’m getting a similar error:

IllegalArgumentException: No such Gstreamer factory: udpsrc port=5001

Maybe I’m not getting the syntax right?

Not a chance that the code that in the video library for custom pipelines can possibly work - it’s completely broken - https://github.com/processing/processing-video/blob/r6-v2.0-beta4/src/processing/video/Capture.java#L425

Your only option would be to subclass Capture and rewrite that method. :confounded:

@NaniAromix It is unfortunate :confounded: that you are in a position where:-

  1. The RaspberryPi is no longer officially supported, the last support finished with the Stretch distro on RaspberryPI3B+.
  2. It seems from @neilcsmith (and he should know) CustomPipeline is still a work in progress by @codeanticode see here.
  3. I know @kll has had success with compiling glvideo afresh on Buster, albeit with RaspberryPI3B+, but that doesn’t seem too attractive to me.
1 Like

Ha, yes, I’d forgotten that issue conversation! :+1: Was just about to file another one related to this thread. That’s exactly the problem - manual parsing of the pipeline dealing only with elements, not properties, caps, bins, automatic dynamic connections, etc. etc. Linked across from the issue to here.

1 Like

Seems like there’s no easy solution to this. I’m thinking of rewriting the “initCustomPipeline()” method you mentioned, but I’m kind of lost at the moment. What is the main issue with the current implementation?

Might openFrameworks work better in this case? No idea how complex your project is…

Sorry for the late reply!

It should be using Gst.parseLaunch() to build the whole pipeline from a String using the underlying GStreamer support for this. If you give certain elements a name property, you can then extract them from the pipeline by name for the elements that the library needs access to (eg. the appsink).

1 Like