Projet

Général

Profil

GStreamer » Historique » Version 3

Version 2 (P.G Bareges, 25/02/2013 22:13) → Version 3/9 (P.G Bareges, 25/02/2013 22:17)

h1. GStreamer

h2. command line


h3. simple theora encoding stream 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.

<pre>
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

</pre>


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.

h3. rtp

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

<pre>

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

</pre>

h2. Processing

<pre>
/**
* 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);
}
}

</pre>

h2. 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