jpegenc a theora playbin2 buffer?

Erik Blankinship jedierikb at gmail.com
Mon Sep 19 11:46:39 PDT 2011


On Mon, Sep 19, 2011 at 1:08 PM, Xabier Rodriguez Calvar <
calvaris at igalia.com> wrote:

> O Lun, 19-09-2011 ás 12:08 -0400, Erik Blankinship escribiu:
> > But two problems arise:
> >      1. It appears red and blue have been swapped in my pixbuf.  Do I
> >         need to run the buffer through a pre-process before
> >         pixbuf_new_from_data?
>
>         I had used this at an old piece of code in C:
>
>                pixbuf = gdk_pixbuf_new_from_data(
>                        GST_BUFFER_DATA(new_buffer), GDK_COLORSPACE_RGB,
>                        FALSE, 8, width, height,
>                        GST_ROUND_UP_4(3 * width), _destroy_pixbuf,
>                        new_buffer);
>
>
I am continuing to have trouble with this.  Most every combination I try
ends up with a distorted image.  Further, there doesn't appear to be a pygst
counterpart to GST_ROUND_UP_4, but it is easy enough to compute.

def f(num):
    return (num + 3) & ~3

If it is of help to anyone out there, my caps read as follows:

video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321,
red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216,
width=(int)512, height=(int)277, framerate=(fraction)24/1,
pixel-aspect-ratio=(fraction)1/1, color-matrix=(string)sdtv,
chroma-site=(string)jpeg;


What's the thinking and solution behind mapping this buffer into a gdk
pixbuf successfully?


>
> >      1. What is the best way to get the values for the width and
> >         height of the buffer we're converting to a pixbuf?  Grab and
> >         cache them from the playbin2?
>
> You have them in the code I pasted. They should be in the the buffer
> caps.


Yes, of course.  Thanks again for that.

In pygst for future searchers:

caps = last_frame.get_caps()[0]
width = int(caps["width"])
height = int(caps["height"])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110919/4fa91cf8/attachment-0001.htm>


More information about the gstreamer-devel mailing list