Why Gstreamer change explicitly declared caps of appsrc in runtime?

Gary Metalle Gary.Metalle at rvl.co.uk
Tue Sep 29 16:08:50 UTC 2020


Hi

It can't be a coincidence that the caps of the appsrc is for BGR and not NV12. This must mean you are inserting BGR frames and not NV12?

A couple of tests...

Try removing the caps altogether and see if that works and what frames you actually get out.

Also try inserting a videoconvert block just before the filesink so that it will convert if necessary.
________________________________________
From: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> on behalf of sarslan <sukrubahadirarslan at gmail.com>
Sent: 29 September 2020 10:06
To: gstreamer-devel at lists.freedesktop.org
Subject: Why Gstreamer change explicitly declared caps of appsrc in runtime?

Hello,
I am trying to develop an application with using appsrc element of
Gstreamer.
Gstreamer pipeline is very simple:
*"appsrc caps=video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 !
filesink location=/home/sarslan/out.nv12"*

I insert NV12 frame to this pipeline but the output "out.nv12" file size is
0 bytes.
Because of this, I searched for gstreamer logs and here is the output:

*0:00:00.278040860 16433   0x7f70004b30 DEBUG                 appsrc
gstappsrc.c:1344:gst_app_src_set_caps:<appsrc0> setting caps to video/x-raw,
format=(string)NV12, width=(int)1280, height=(int)720,
framerate=(fraction)30/1
*
0:00:00.278505540 16433   0x7f70004b30 DEBUG                 appsrc
gstappsrc.c:688:gst_app_src_internal_get_caps:<appsrc0> caps: (NULL)
0:00:00.278589460 16433   0x7f70004b30 DEBUG                 appsrc
gstappsrc.c:688:gst_app_src_internal_get_caps:<appsrc0> caps: (NULL)
*0:00:00.278736430 16433   0x7f70004b30 DEBUG                 appsrc
gstappsrc.c:1344:gst_app_src_set_caps:<appsrc0> setting caps to video/x-raw,
format=(string)BGR, width=(int)1280, height=(int)720,
framerate=(fraction)30/1
*
0:00:00.278782890 16433   0x7f70004b30 DEBUG                 appsrc
gstappsrc.c:1509:gst_app_src_set_stream_type:<appsrc0> setting stream_type
of 0
0:00:00.278820150 16433   0x7f70004b30 DEBUG                 appsrc
gstappsrc.c:1401:gst_app_src_set_size:<appsrc0> setting size of -1
0:00:00.279119090 16433   0x7f70004b30 DEBUG                 appsrc
gstappsrc.c:865:gst_app_src_start:<appsrc0> starting
0:00:00.279575060 16433     0x37769e30 DEBUG                 appsrc
gstappsrc.c:688:gst_app_src_internal_get_caps:<appsrc0> caps: (NULL)

What I understand from this log is, the caps of the appsrc element changed
in runtime and this is the reason of why the output file is 0 bytes.

So, The first question is: Why gstreamer override my caps and set its own
caps in runtime ? And the second question is: How can I disable this
behaviour ?

Thanks.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list