GStreamer » Historique » Version 3
P.G Bareges, 25/02/2013 22:17
1 | 1 | P.G Bareges | h1. GStreamer |
---|---|---|---|
2 | 1 | P.G Bareges | |
3 | 1 | P.G Bareges | |
4 | 2 | P.G Bareges | h2. command line |
5 | 3 | P.G Bareges | |
6 | 3 | P.G Bareges | |
7 | 2 | P.G Bareges | h3. simple theora encoding stream over udp |
8 | 1 | P.G Bareges | |
9 | 3 | P.G Bareges | *nécessite de lancer le receiver avant le sender... |
10 | 3 | P.G Bareges | *reprise possible du flux d'émission apres l'initialisation des 2 pipelines (sender/receive) |
11 | 3 | P.G Bareges | *ne marche pas sous windows. |
12 | 3 | P.G Bareges | |
13 | 1 | P.G Bareges | <pre> |
14 | 1 | P.G Bareges | Sender : |
15 | 1 | P.G Bareges | gst-launch-0.10 -v v4l2src device=/dev/video0 ! \ |
16 | 1 | P.G Bareges | 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! \ |
17 | 1 | P.G Bareges | theoraenc ! udpsink host=10.20.0.62 port=1234 |
18 | 1 | P.G Bareges | |
19 | 1 | P.G Bareges | Receiver : |
20 | 1 | P.G Bareges | gst-launch-0.10 -v udpsrc port=1234 \ |
21 | 1 | P.G Bareges | caps="video/x-theora, width=640, height=480, framerate=30/1, pixel-aspect-ratio=1/1" ! \ |
22 | 1 | P.G Bareges | theoradec ! xvimagesink |
23 | 1 | P.G Bareges | |
24 | 1 | P.G Bareges | stats on i7-2620M |
25 | 1 | P.G Bareges | |
26 | 1 | P.G Bareges | ps -eo psr,pid,tid,class,rtprio,ni,pri,pcpu,stat,wchan:14,comm | grep [g]st |
27 | 1 | P.G Bareges | 3 23360 23360 TS - 0 19 8.6 Sl+ poll_schedule_ gst-launch-0.10 |
28 | 2 | P.G Bareges | 2 23363 23363 TS - 0 19 47.8 Sl+ poll_schedule_ gst-launch-0.10 |
29 | 1 | P.G Bareges | |
30 | 1 | P.G Bareges | </pre> |
31 | 1 | P.G Bareges | |
32 | 3 | P.G Bareges | |
33 | 2 | P.G Bareges | h3. rtp |
34 | 2 | P.G Bareges | |
35 | 3 | P.G Bareges | *le serveur envoie ses caps toute les 5 secondes via config-interval=5 |
36 | 3 | P.G Bareges | *marche sous windows \o/ :) |
37 | 2 | P.G Bareges | |
38 | 2 | P.G Bareges | <pre> |
39 | 2 | P.G Bareges | |
40 | 2 | P.G Bareges | sender: |
41 | 2 | P.G Bareges | |
42 | 2 | P.G Bareges | 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 |
43 | 2 | P.G Bareges | |
44 | 2 | P.G Bareges | receiver : |
45 | 2 | P.G Bareges | |
46 | 2 | P.G Bareges | gst-launch-0.10 -v udpsrc port=1234 caps="application/x-rtp" ! rtptheoradepay ! theoradec ! xvimagesink |
47 | 2 | P.G Bareges | |
48 | 2 | P.G Bareges | </pre> |
49 | 2 | P.G Bareges | |
50 | 2 | P.G Bareges | |
51 | 2 | P.G Bareges | |
52 | 1 | P.G Bareges | h2. Processing |
53 | 1 | P.G Bareges | |
54 | 1 | P.G Bareges | <pre> |
55 | 1 | P.G Bareges | /** |
56 | 1 | P.G Bareges | * Ripped from |
57 | 1 | P.G Bareges | * Camera capture pipelines. |
58 | 1 | P.G Bareges | * By Andres Colubri |
59 | 1 | P.G Bareges | * |
60 | 1 | P.G Bareges | * |
61 | 1 | P.G Bareges | */ |
62 | 1 | P.G Bareges | |
63 | 1 | P.G Bareges | import codeanticode.gsvideo.*; |
64 | 1 | P.G Bareges | |
65 | 1 | P.G Bareges | GSPipeline pipeline; |
66 | 1 | P.G Bareges | |
67 | 1 | P.G Bareges | void setup() { |
68 | 1 | P.G Bareges | size(640, 480); |
69 | 1 | P.G Bareges | frameRate(30); |
70 | 1 | P.G Bareges | pipeline = new GSPipeline(this, "udpsrc port=1234 caps=\"video/x-theora, width=640, height=480, framerate=30/1, pixel-aspect-ratio=1/1\" ! theoradec "); |
71 | 1 | P.G Bareges | pipeline.play(); |
72 | 1 | P.G Bareges | } |
73 | 1 | P.G Bareges | |
74 | 1 | P.G Bareges | void draw() { |
75 | 1 | P.G Bareges | // When the GSPipeline.available() method returns true, |
76 | 1 | P.G Bareges | // it means that a new frame is ready to be read. |
77 | 1 | P.G Bareges | if (pipeline.available()) { |
78 | 1 | P.G Bareges | pipeline.read(); |
79 | 1 | P.G Bareges | image(pipeline, 0, 0); |
80 | 1 | P.G Bareges | } |
81 | 1 | P.G Bareges | } |
82 | 1 | P.G Bareges | |
83 | 1 | P.G Bareges | |
84 | 1 | P.G Bareges | </pre> |
85 | 1 | P.G Bareges | |
86 | 1 | P.G Bareges | |
87 | 1 | P.G Bareges | h2. Liens |
88 | 1 | P.G Bareges | |
89 | 2 | P.G Bareges | |
90 | 2 | P.G Bareges | |
91 | 2 | P.G Bareges | *http://gsvideo.sourceforge.net/ |
92 | 2 | P.G Bareges | *http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet |
93 | 2 | P.G Bareges | *http://lists.freedesktop.org/archives/gstreamer-devel/2011-July/032234.html |