Projet

Général

Profil

GStreamer

command line

theora over udp

*nécessite de lancer le receiver avant le sender...
*reprise possible du flux d'émission apres l'initialisation des 2 pipelines (sender/receive)
*ne marche pas sous windows.

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

theora over rtp

*le serveur envoie ses caps toute les 5 secondes via config-interval=5
*marche sous windows \o/ :)


sender: 

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

receiver : 

gst-launch-0.10 -v udpsrc port=1234 caps="application/x-rtp" ! rtptheoradepay ! theoradec ! xvimagesink

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);
  }
}

2 Dazzle DVC 100

pour fonctionner, necessite de connecter les dazzles sur 2 bus differents r

root@stream1:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 2304:021a Pinnacle Systems, Inc. Dazzle DVC100 Audio Device
Bus 002 Device 002: ID 2304:021a Pinnacle Systems, Inc. Dazzle DVC100 Audio Device

Gstreamer theora over udp avec 2 sources video mixé (WIP)

gst-launch-0.10  videomixer name=mix sink_0::zorder=1 sink_1::xpos=480 sink_1::ypos=0 sink_1::zorder=2 ! ffmpegcolorspace ! theoraenc quality=32 ! udpsink host=127.0.0.1 port=1234  v4l2src device=/dev/video1  ! decodebin ! videoscale ! video/x-raw-yuv,width=160,height=120 ! videobox border-alpha=0  ! mix.sink_1 v4l2src device=/dev/video0 ! decodebin ! videoscale ! video/x-raw-yuv,width=640,height=480   ! videobox border-alpha=0 top=0 left=0 ! mix.sink_0

Liens

*http://gsvideo.sourceforge.net/
*http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet
*http://lists.freedesktop.org/archives/gstreamer-devel/2011-July/032234.html
*http://www.noah.org/wiki/video_4_linux_2_notes
*http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet