After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743334 - videoaggregator crash when work with filesrc
videoaggregator crash when work with filesrc
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal minor
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-22 07:10 UTC by comicfans44
Modified: 2015-01-26 09:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vidotestsrc generated 320x240 yv12 raw 1 frame (112.50 KB, application/octet-stream)
2015-01-26 02:04 UTC, comicfans44
Details

Description comicfans44 2015-01-22 07:10:17 UTC
gst-plugins-bad version tested :  d825239b(lastest)   1200f2(earlier, also crash)


videotestsrc ! glvideomixer ! glimagesink works OK

but load raw frame through filesrc crash gstvideoaggregator

dump file :

gst-launch-1.0 videotestsrc num-buffers=100 ! video/x-raw,format=YV12,width=320,height=240  ! filesink location=320_240.yv12


load through filesrc crash :

gst-launch-1.0 filesrc location=320_240.yv12 blocksize=115200 do-timestamp=1 ! video/x-raw,format=YV12,width=320,height=240,framerate=1/1  ! glvideomixer ! glimagesink

(filesrc ! glimagesink works, only crash when glvideomixer inside)

crash at gst_videoaggregator_fill_queues
line 969
seems the buf which will be unref already has refcount=0

{mini_object = {type = 0, refcount = 0, lockstate = -1, flags = 4294967295, copy = 0xffffffff, dispose = 0xffffffff, free = 0xffffffff, 
    n_qdata = 4294967295, qdata = 0xffffffff}, pool = 0xffffffff, pts = 18446744073709551615, dts = 18446744073709551615, duration = 18446744073709551615, 
  offset = 18446744073709551615, offset_end = 18446744073709551615}


backtrace as


gst_mini_object_unref (mini_object=0x96a4e80) at ../../gst/gstminiobject.c:446
  • #8 gst_buffer_unref
    at /opt/gstreamer-1.5-gcc/include/gstreamer-1.0/gst/gstbuffer.h line 360
  • #9 gst_videoaggregator_fill_queues
    at ../../../../gst-libs/gst/video/gstvideoaggregator.c line 969
  • #10 gst_videoaggregator_aggregate
    at ../../../../gst-libs/gst/video/gstvideoaggregator.c line 1286
  • #11 gst_aggregator_aggregate_func
    at ../../../../gst-libs/gst/base/gstaggregator.c line 638

Comment 1 Matthew Waters (ystreet00) 2015-01-22 08:41:03 UTC
What happens if you put a videoparse in between filesrc and glvideomixer ?

i.e filesrc ! videoparse format=yv12 width=320 height=240 ! glvideomixer ...

Also, does the same thing happen with compositor?

And could you attach a small sample file to test with please.
Comment 2 comicfans44 2015-01-26 02:04:03 UTC
Created attachment 295406 [details]
vidotestsrc generated 320x240 yv12 raw 1 frame

(In reply to comment #1)
> What happens if you put a videoparse in between filesrc and glvideomixer ?
> 
> i.e filesrc ! videoparse format=yv12 width=320 height=240 ! glvideomixer ...
> 
 
I run as 

gst-launch-1.0 filesrc location=320_240.yv12 blocksize=115200 do-timestamp=1 ! videoparse format=yv12 width=320 height=240 framerate=100/1 ! glvideomixer ! glimagesink

interesting, it didn't crash, does this mean this is problem in filesrc ?

gstreamer version I tested : 9494b69 and ee3db74, 
both videoparse inside works, 
both crash when videoparse not inside  

> Also, does the same thing happen with compositor?

yes, crash at same line ,also tested with fakesink

> 
> And could you attach a small sample file to test with please.

attachment is the raw frame data created by videotestsrc, but I think 
any binary can be used as input (like /dev/urandom )
Comment 3 Matthew Waters (ystreet00) 2015-01-26 09:03:20 UTC
(In reply to comment #2)
> Created an attachment (id=295406) [details]
> vidotestsrc generated 320x240 yv12 raw 1 frame
> 
> (In reply to comment #1)
> > What happens if you put a videoparse in between filesrc and glvideomixer ?
> > 
> > i.e filesrc ! videoparse format=yv12 width=320 height=240 ! glvideomixer ...
> > 
> 
> I run as 
> 
> gst-launch-1.0 filesrc location=320_240.yv12 blocksize=115200 do-timestamp=1 !
> videoparse format=yv12 width=320 height=240 framerate=100/1 ! glvideomixer !
> glimagesink
> 
> interesting, it didn't crash, does this mean this is problem in filesrc ?
> 
> gstreamer version I tested : 9494b69 and ee3db74, 
> both videoparse inside works, 
> both crash when videoparse not inside  

No, it means that filesrc is not providing the size of buffer that compositor/glvideomixer/'any other video element' wants.  Which is what videoparse is fixing up for you.  The convention with GStreamer is one buffer == one video frame which may have not been true by the buffers output by filesrc.  Marking as invalid for this reason.
Comment 4 Tim-Philipp Müller 2015-01-26 09:26:04 UTC
The problem is with your pipeline. You need to use a videoparser in this case.

However, glvideomixer should also not crash, but error out!

commit 21168dd1996c5c668ec4e7a709a6d2991455b7c8
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Mon Jan 26 09:22:23 2015 +0000

    videoaggregator: fix crash when receiving buffer without timestamps
    
    Unset out buffer in clip function when we unref the buffer to be
    clipped, otherwise aggregator will continue to use the already-
    freed buffer. Fixes crash when buffers without timestamps are
    being fed to aggregator. Partly because aggregator ignores the
    error flow return.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=743334