Projet

Général

Profil

GStreamer » Historique » Version 1

Version 1/9 - Suivant » - Version actuelle
P.G Bareges, 25/02/2013 20:29


GStreamer

from command line : simple theora encoding stream over udp

Sender : 
 gst-launch-0.10 -v v4l2src device=/dev/video0 ! \
 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! \
 theoraenc ! udpsink host=10.20.0.62 port=1234

Receiver :
gst-launch-0.10 -v udpsrc port=1234 \
 caps="video/x-theora, width=640, height=480, framerate=30/1, pixel-aspect-ratio=1/1" ! \
 theoradec ! xvimagesink 

stats on i7-2620M

 ps -eo psr,pid,tid,class,rtprio,ni,pri,pcpu,stat,wchan:14,comm | grep [g]st
  3 23360 23360 TS       -   0  19  8.6 Sl+  poll_schedule_ gst-launch-0.10
  2 23363 23363 TS       -   0  19 47.8 Sl+  poll_schedule_ gst-launch-0.10

Processing

/**
 * Ripped from
 * Camera capture pipelines. 
 * By Andres Colubri
 * 
 * 
 */

import codeanticode.gsvideo.*;

GSPipeline pipeline;

void setup() {
  size(640, 480);
  frameRate(30);
  pipeline = new GSPipeline(this, "udpsrc port=1234 caps=\"video/x-theora, width=640, height=480, framerate=30/1, pixel-aspect-ratio=1/1\" ! theoradec ");  
  pipeline.play();
}

void draw() {
  // When the GSPipeline.available() method returns true, 
  // it means that a new frame is ready to be read.
  if (pipeline.available()) {
    pipeline.read();
    image(pipeline, 0, 0);
  }
}

Liens

http://gsvideo.sourceforge.net/