title: Adding opencv processing to gstreamer application
body: <p>I'm trying to do the following: receive video stream using gstreamer and process it with opencv. I've found few solutions, and one of them is to write video into (from gstreamer) fifo and then read it using opencv. (OPTION3 here <a href="https://stackoverflow.com/questions/6022423/mjpeg-streaming-and-decoding">MJPEG streaming and decoding</a>). The problem is I cant open pipe. cvCreateFileCapture just never returns. Here is a part code I wrote:</p>
  
  <pre><code>if(mkfifo("fifo.avi", S_IRUSR| S_IWUSR) == -1)
  {
      cout&lt;&lt;"Cant create fifo"&lt;&lt;endl;
      cout&lt;&lt;errno&lt;&lt;endl;
  }
  
  loop = g_main_loop_new(NULL, false);
  
  fsink = gst_element_factory_make("filesink", "fsink");
  g_object_set(G_OBJECT(fsink), "location", "fifo.avi", NULL);
  
  playbin = gst_element_factory_make("playbin2", "play");    
  g_object_set(G_OBJECT(playbin), "uri", uri.c_str(), NULL);
  g_object_set(G_OBJECT(playbin), "video-sink", fsink, NULL);
  
  bus = gst_pipeline_get_bus(GST_PIPELINE(playbin));
  gst_bus_add_signal_watch(bus);
  
  g_signal_connect(bus, "message::buffering", G_CALLBACK(&amp;set_playbin_state), playbin);
  gst_object_unref(bus);
  
  cvNamedWindow("output", CV_WINDOW_AUTOSIZE);
  capture = cvCreateFileCapture("fifo.avi");
  </code></pre>
  
  <p>The program stacks in the last line. 
  PS: I'm using opencv 2.3.1. </p>