Fwd: Python: procedural video and audio mix in

Stefan Kost ensonic at hora-obscura.de
Sun Aug 7 03:32:55 PDT 2011


On 08/06/11 09:39, Mikko Ohtamaa wrote:
> On Sat, Aug 6, 2011 at 10:12 AM, Kapil Agrawal <kapil.agl at gmail.com> wrote:
>> What do you mean by dumping video frames from python to gstreamer. So for
>> example if you want to write a gstreamer pipeline for doing gst-launch-0.10
>> filesrc location=test.mp4 ! decodebin2 ! xvimagesink ,
> For example I generate a series of images like this:
>
> for frame in range(0, 10000): # let's render 10000 frames of video
>  data = []
>  for y in range(0, height):
>      for x in range(0, width):
>            data[y*width+x] = random.randint(0, 2**31) # rgba pixel
>  # XXX: how to create a video frame in GStreamer pipeline in this
> point based on the image data created above

you can use appsrc or better write an own source element. The own source
element is the better strategy (although there might be not so many
examples for writing that from python).

Stefan
> ... now, how do I feed this raw image data to gstreamer, so that it'll
> put it to the video track alongside audio coming from a file.
>
> I probably need to interact with buffers somehow, but I didn't find
> example and I am very clueless with GStreamer, so if anyone could
> point me to the right direction I'd be happy.
>
> Hope this helps,
> Mikko
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list