the phrygian cap


luisbg

@luisbg

luis@debethencourt.com



Ohloh profile for Luis de Bethencourt
Blogalia




<Mayo 2018
Lu Ma Mi Ju Vi Sa Do
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Creative Commons License


planet gnome
planet ubuntu
alberto ruiz
andy wingo
jeff fortin
slomo's blog
jan schmidt
vincent's random waffle



"all religions, arts and sciences are branches of the same tree. all these aspirations are directed toward ennobling man's life, lifting it from the sphere of mere physical existence and leading the individual towards freedom." albert einstein

awesome (gstreamer * clutter)






it is a known fact that gstreamer and clutter are both very cool. so what if we have gstreamer inside clutter, that is cool^2 which equals awesome.

let's go through a simple example awesome.py. the key of gstreamer inside clutter is the cluttergst python and its VideoSink function.

so you are going to create a gstreamer pipeline (just like we did in the previous blog post just shoot me), but use the cluttergst.VideoSink instead of gst element xvimagesink and feed that to a clutter.Texture():

import clutter, gst, cluttergst

video_texture = clutter.Texture()
pipeline = gst.Pipeline()
src = gst.element_factory_make("v4l2src", "src")
colorspace = gst.element_factory_make("ffmpegcolorspace", "colorspace")
sink = cluttergst.VideoSink(video_texture)
pipeline.add(src, colorspace, sink)
gst.element_link_many(src, colorspace, sink)
pipeline.set_state(gst.STATE_PLAYING)


now you need a clutter stage with the videotexture in it:

stage = clutter.stage_get_default()
stage.add(video_texture)
stage.set_size(800,600)


wait, this is clutter... let's animate the gstreamer texture! for this you need a clutter timeline, alpha (value as function of time) and behaviour:

timeline = clutter.Timeline(250,50)
timeline.set_loop(True)
alpha = clutter.Alpha(timeline, clutter.sine_half_func)
behaviour = clutter.BehaviourRotate(alpha=alpha, \
angle_start=30.0, angle_end=5.0, axis=clutter.Y_AXIS, \
direction = "ccw")
behaviour.apply(video_texture)


we are ready for the show:

timeline.start()
stage.show_all()
clutter.main()



wasn't that awesome \m/?

now check the example awesome.py, it has videofile playback and more animation behaviours.

21 Comentarios


Referencias (TrackBacks)

URL de trackback de esta historia http://luisbg.blogalia.com//trackbacks/61951

Comentarios

1
De: Flimm Fecha: 2009-02-16 21:50

Why isn't python-clutter included in the Intrepid universe repos?
I tried installing python-clutter from Jaunty's repos, but all awesome.py would give me was a black window. Is it meant to work with your webcam?



2
De: luisbg Fecha: 2009-02-16 22:42

./awesome.py
will use the webcam
./awesome.py -i /path/to/videofile
will play a videofile


don't know about the intrepid repo issue.



3
De: Senko Fecha: 2009-02-17 00:36

There's also cluttergst.VideoTexture that encompasses Texture+Playbin+VideoSink functionality.

tx = cluttergst.VideoTexture()
tx.set_uri(content_uri)
tx.set_playing(True)
bin = tx.get_playbin() # if you want to use the inner Playbin directly



4
De: luisbg Fecha: 2009-02-17 01:11

senko: wow! I didn't knew that. that is brilliant.



5
De: martin Fecha: 2009-07-07 14:52

Using kubuntu jaunty:

$ python clutter.py
Fatal Python error: unable to initialise cluttergst module
Cancelado




6
De: deepsight Fecha: 2010-04-21 18:04

Have you tried having two videos at the same time? i try with one v4l2src and one videotestsrc; they show on the screen but they pause continuously at the same time. Any ideas?



7
De: curcumin Fecha: 2012-03-29 14:21

This one is your one of the nice blog dude I like it very much so I want to keep in touch with your blogs therefore post more blogs and thank you dear for sharing with us such nice information.



8
De: maquinas de bordar Fecha: 2012-03-30 07:54

I like the valuable information you provide in your articles. I’ll bookmark your weblog and check again here frequently. I am quite sure I will learn many new stuff right here! Best of luck for the next!



9
De: Anónimo Fecha: 2018-04-02 00:08

Wonderful web journal. I appreciated perusing your articles. This is really an extraordinary read for me. I have bookmarked it and I am anticipating perusing new articles. Keep doing awesome! bahis şirketleri



10
De: Anónimo Fecha: 2018-04-10 11:37

This is an awesome post. I like this topic.This site has heaps of advantage.I discovered numerous fascinating things from this site. It helps me in numerous ways.Thanks for posting this once more. Buy cheap Revit 2018 software price



11
De: Anónimo Fecha: 2018-04-16 13:55

I as of late discovered numerous helpful data in your site particularly this online journal page. Among the loads of remarks on your articles. A debt of gratitude is in order for sharing. Grammarly Trial



12
De: Anónimo Fecha: 2018-04-16 23:36

Wonderful web journal. I appreciated perusing your articles. This is really an extraordinary read for me. I have bookmarked it and I am anticipating perusing new articles. Keep doing awesome! hasejaafashion.com



13
De: Anónimo Fecha: 2018-04-17 14:33

I wish more writers of this kind of substance would take the time you did to look into and compose so well. I am exceptionally inspired with your vision and understanding. Mattress cleaning service



14
De: Anónimo Fecha: 2018-04-24 13:07

exceptionally fascinating continue posting. zhuilu old trail tour



15
De: Anónimo Fecha: 2018-04-30 09:49

A debt of gratitude is in order for this article exceptionally accommodating. much appreciated. cryptosuite trading software



16
De: Anónimo Fecha: 2018-05-03 10:25

Wow, superb blog layout! How lengthy have you ever been blogging for? you make blogging glance easy. The whole glance of your website is fantastic, well the content material! quartz countertops Dallas



17
De: Anónimo Fecha: 2018-05-09 09:38

Howdy! A debt of gratitude is in order for the considerable data you havr gave! You have touched on crucuial focuses! Tube Funnel



18
De: Anónimo Fecha: 2018-05-09 12:40

Can I simply say what a relief to locate somebody that actually knows what exactly theyre speaking about on the web. You certainly know how to bring an issue to light and make it important. More people have to look at this and understand this side of the story. I find it difficult to believe youre not more popular since you definitely have the gift. bathroom fixtures and accessories



19
De: Anónimo Fecha: 2018-05-09 12:40

I regard something truly special in this website . watch



20
De: Anónimo Fecha: 2018-05-12 09:08

Gucci Handbags I??????ve been visiting your blog site for a time now we always look for a gem in your new posts. Nice one for sharing. commercial real estate for sale



21
De: Anónimo Fecha: 2018-05-16 14:00

I always insisting my dad that not all headlines posted online are original but this post can be an exceptional to my rule. custom software development company



Nombre
Correo-e
URL
Dirección IP: 23.20.240.193 (983fc244f9)
Comentario
¿Cuánto es: mil + uno?

©2007-2015 luis de bethencourt guimera
powered by Blogalia