jackersson / gst-python-plugins

42 stars 12 forks source link

PLAYING instead of the NULL state #5

Open abaybektursun opened 3 years ago

abaybektursun commented 3 years ago

When I run gst-launch-1.0 videotestsrc ! gaussian_blur kernel=9 sigmaX=5.0 sigmaY=5.0 ! videoconvert ! autovideosink I get this:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR  | root                 | 18.09 00:33:00.834 | Dummy-1 | cannot reshape array of size 307200 into shape (240,320,3)
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

(gst-launch-1.0:548): GStreamer-CRITICAL **: 00:33:00.836: 
Trying to dispose element gstblur_py+gstgaussianblur0, but it is in PLAYING instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.

ERROR  | root                 | 18.09 00:33:00.836 | Dummy-1 | cannot reshape array of size 307200 into shape (240,320,3)

(gst-launch-1.0:548): GStreamer-CRITICAL **: 00:33:00.870: 
Trying to dispose element gstblur_py+gstgaussianblur0, but it is in PLAYING instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.

sys:1: Warning: g_object_ref: assertion 'G_IS_OBJECT (object)' failed
Caught SIGSEGV
Spinning.  Please run 'gdb gst-launch-1.0 548' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.
Segmentation fault (core dumped)

Any idea what's happening?

petergerten commented 3 years ago

ERROR | root | 18.09 00:33:00.836 | Dummy-1 | cannot reshape array of size 307200 into shape (240,320,3) @abaybektursun I have the exact same issue. It seems that the videotestsrc has 4 channels (RGBA I assume?) - so it would be 320 240 4 = 307200 in size. But the target shape is RGB (320 240 3).

I tinkered a bit in the code but could not solve the problem yet. @jackersson any hints?

petergerten commented 3 years ago

ok, it turns out I can do the following before and after the custom element to solve the issue:

video/x-raw, format=RGBA ! videoconvert

subodh-malgonde commented 2 years ago

@petergerten Thanks for the hint. Actually you only need video/x-raw, format=RGBA before the custom plugin.

gst-launch-1.0 videotestsrc ! video/x-raw, format=RGBA ! gaussian_blur ! videoconvert ! autovideosink