Why Gstreamer change explicitly declared caps of appsrc in runtime?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Why Gstreamer change explicitly declared caps of appsrc in runtime?

sarslan
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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Why Gstreamer change explicitly declared caps of appsrc in runtime?

Gary Metalle
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 <[hidden email]> on behalf of sarslan <[hidden email]>
Sent: 29 September 2020 10:06
To: [hidden email]
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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Why Gstreamer change explicitly declared caps of appsrc in runtime?

sarslan
Hello,
I wrote raw frame to file before send it to the pipeline.
Then I display it with "https://rawpixels.net/" and vooya(raw image viewer
in linux).
From both method, I saw that the format of the raw frame is NV12. I upload
the file in here.
I view this file in "https://rawpixels.net/" with the following settings:
height:720, width: 1280, Predefined format: NV12, Pixel format: YUV.

And also I tried to insert videoconvert block just after the appsrc. In this
block, I tried to convert format to NV12 but this is not work also.
out_test.nv12
<http://gstreamer-devel.966125.n4.nabble.com/file/t379659/out_test.nv12>  



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