[gst-devel] Another GstAppSrc Question

John Stowers john.stowers.lists at gmail.com
Thu Dec 2 20:42:45 CET 2010


On Fri, Dec 3, 2010 at 8:06 AM, John Stowers
<john.stowers.lists at gmail.com> wrote:
> On Fri, Dec 3, 2010 at 1:11 AM, ved kpl <ved.kpl at gmail.com> wrote:
>> On Thu, Dec 2, 2010 at 4:24 PM, John Stowers
>> <john.stowers.lists at gmail.com> wrote:
>>> On Thu, Dec 2, 2010 at 10:52 PM, Prabhulinga Swamy B S
>>> <prabhulingaswamy.bs at globaledgesoft.com> wrote:
>>>> Hi John,
>>>>
>>>> You can just leave out the filter you are doing between 'appsrc' and
>>>> 'ffmpegcolorspace'.
>>>> That is not required since you are setting the caps of appsrc, that fine.
>>>> Have you tried like this?
>>>
>>> Yeah. The solution was to add a videoparse filter (noted in another reply).
>>
>>   Also, u need not set any caps on appsrc.
>
> Is this the recommended way of doing things? It feels like it breaks
> abstraction / the point of caps. I mean I wanted to support streaming
> multiple video types by only setting different caps on the appsrc and
> letting ffmpegcolorspace convert to what was necessary.
>
> So I suspect the root cause of why those caps failed to work remains
> unknown. It does not matter even if I set all the rgb caps, still no
> success.

Got it, I had the wrong mask values - I was assuming RGBA and it looks
like the mask is applied against ARGB. The following works

  caps = gst_caps_new_simple ("video/x-raw-rgb",
                "width", G_TYPE_INT, 640,
                "height", G_TYPE_INT, 480,
                "bpp", G_TYPE_INT, 24,
                "depth", G_TYPE_INT, 24,
                "red_mask",   G_TYPE_INT, 0x00ff0000,
                "green_mask", G_TYPE_INT, 0x0000ff00,
                "blue_mask",  G_TYPE_INT, 0x000000ff,
                "framerate", GST_TYPE_FRACTION, 25, 1,
                "endianness", G_TYPE_INT, G_BIG_ENDIAN,
                NULL);

Seems odd that I need to set the framerate on my appsrc (it is
streaming, with largely unknown rate), but oh well.

Thanks all for the help.

John


>
> Do you know how I might solve this while maintaining the abstraction
> of video type through only the setting of caps?
>
> Full code is here;
> https://gist.github.com/725122
>
> Thanks,
>
> John
>
>>>
>>> Thanks,
>>>
>>> John
>>
>>
>>
>>>>
>>>> app->pipeline = gst_parse_launch("appsrc name=mysource ! "
>>>>        " ffmpegcolorspace ! videoscale method=1 ! theoraenc bitrate=150 ! udpsink "
>>>>        " host=127.0.0.1 port=1234", NULL);
>>>>
>>>>
>>>> Prabhu
>>>>
>>>>
>>>>
>>>> On 12/02/2010 11:28 AM, John Stowers wrote:
>>>>> Hi All,
>>>>>
>>>>> I see quite a few similar questions to these on the gst-devel mailing
>>>>> list, but none of them allowed me to get past my problem.
>>>>>
>>>>> I'm building a streaming video thing using gstreamer, the prototype
>>>>> (works fine) is
>>>>>
>>>>> sender:
>>>>> gst-launch -v videotestsrc !
>>>>> video/x-raw-rgb,width=640,height=480,bpp=24,depth=24 !
>>>>> ffmpegcolorspace ! videoscale method=1 ! theoraenc bitrate=150 ! udpsink
>>>>> host=127.0.0.1 port=1234
>>>>>
>>>>> viewer:
>>>>> gst-launch -v udpsrc port=1234 ! theoradec ! autovideosink
>>>>>
>>>>> I have been translating it to C starting with the appsrc-stream example.
>>>>> I can't get it to negotiate the caps I set properly. The relevant
>>>>> warning messages are;
>>>>>
>>>>> basetransform
>>>>> gstbasetransform.c:1047:gst_base_transform_acceptcaps:<videoscale0>
>>>>> transform could not transform video/x-raw-rgb, bpp=(int)24,
>>>>> depth=(int)24, width=(int)640, height=(int)480 in anything we support
>>>>> 0:00:00.178133697 10789  0x829a8d0 WARN           basetransform
>>>>> gstbasetransform.c:1144:gst_base_transform_setcaps:<ffmpegcsp0>  FAILED
>>>>> to configure caps<ffmpegcsp0:src>  to accept video/x-raw-yuv,
>>>>> format=(fourcc)I420, framerate=(fraction)1/2147483647, width=(int)640,
>>>>> height=(int)480
>>>>>
>>>>> The relevant code is;
>>>>>
>>>>> app->pipeline = gst_parse_launch("appsrc name=mysource !
>>>>> video/x-raw-rgb,width=640,height=480,bpp=24,depth=24 !
>>>>> ffmpegcolorspace ! videoscale method=1 ! theoraenc bitrate=150 ! udpsink
>>>>> host=127.0.0.1 port=1234", NULL);
>>>>>
>>>>> <snip>
>>>>>
>>>>> caps = gst_caps_new_simple ("video/x-raw-rgb",
>>>>>      "bpp",G_TYPE_INT,24,
>>>>>      "depth",G_TYPE_INT,24,
>>>>>       "width", G_TYPE_INT, 640,
>>>>>       "height", G_TYPE_INT, 480,
>>>>>       NULL);
>>>>> gst_app_src_set_caps(GST_APP_SRC(app->appsrc), caps);
>>>>>
>>>>> Full source code is here
>>>>> http://pastebin.com/PJuGVJLC
>>>>>
>>>>> Any pointers?
>>>>>
>>>>> John
>>>>>
>>>>>
>>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
>>>> Tap into the largest installed PC base & get more eyes on your game by
>>>> optimizing for Intel(R) Graphics Technology. Get started today with the
>>>> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
>>>> http://p.sf.net/sfu/intelisp-dev2dev
>>>> _______________________________________________
>>>> gstreamer-devel mailing list
>>>> gstreamer-devel at lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
>>> Tap into the largest installed PC base & get more eyes on your game by
>>> optimizing for Intel(R) Graphics Technology. Get started today with the
>>> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
>>> http://p.sf.net/sfu/intelisp-dev2dev
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> gstreamer-devel at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>>
>>
>> ------------------------------------------------------------------------------
>> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
>> Tap into the largest installed PC base & get more eyes on your game by
>> optimizing for Intel(R) Graphics Technology. Get started today with the
>> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
>> http://p.sf.net/sfu/intelisp-dev2dev
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>




More information about the gstreamer-devel mailing list