반응형
오늘 Gstreamer 를 봤는데

아주 기똥차게 되어있었다.

너무 훌륭한 framework를 발견해서 기뻤다.


그러다가 혹시 python 에서 쓸수 있지 않을까.... 싶어서 한 다섯시간 삽질했다.

이것 깔고 저것 깔고 별별것을 다 깔면서 하나하나 에러를 잡아나갔다.

그러나

마지막 최종 보스

python: symbol lookup error: /usr/lib/python2.6/dist-packages/gst-0.10/gst/_gst.so: undefined symbol: gst_structure_change_type_get_type

이 에러를 못잡아서

결국엔 돌려보지도 못했다.

이게 도대체 뭔 개소리란 말인가....

저 공유오브젝트 파일에 저 심볼이 선언되어 있지 않다는것 같은데.... gst 버전이 달라서 그런가 해서

python-gst를 stable 버전, unstable 버전 다 깔아보고 awesome 이라는 놈도 깔아보고

패키지도 다 깔았다가 하나씩 지워가면서 해보고

소스로 받아다가 빌드해서 깔아도보고 그래도 안되고....

ㅠ.ㅠ


젝일....


이짓 하다가 xwindow 날려먹었다. 아마 gtk 관련 패키지 깔다가 꼬였나보다. ㅠ.ㅠ

이제 x로 들어가지도 못한다. ㅠ.ㅠ

아흑....

누구 gstreamer python 으로 쓰는 방법 아시는분 저 에러좀 잡아주세요

아니면 개발환경 세팅방법좀 알려주세요 ㅠ.ㅠ



아... 짱나. 리눅스 다시 깔으야겠네....



아 삽질하다가 하나 괜찬아 보이는 것을 찾았다.
http://clutter-project.org/download.html
http://luisbg.blogalia.com/historias/61951

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. 
반응형
Posted by Real_G