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 688934 - Gst.Event.parse_stream_start seems to not function correctly
Gst.Event.parse_stream_start seems to not function correctly
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.x
Other Linux
: Normal normal
: 1.0.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-23 13:34 UTC by Christian Fredrik Kalager Schaller
Modified: 2012-11-23 20:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Fredrik Kalager Schaller 2012-11-23 13:34:08 UTC
Trying to parse the stream-start to get hold of the stream id. But I am getting some weird errors.The code I have is this:
def padprobe(self, pad, probeinfo, userdata):
       event=Gst.PadProbeInfo.get_event(probeinfo)
       streamid=Gst.Event.parse_stream_start(event)
       print(event)
       print(streamid)

Which comes out of a :
src_pad.add_probe(Gst.PadProbeType.EVENT_DOWNSTREAM, self.padprobe, "user data")

However when this runs:
(transmageddon.py:14655): GStreamer-CRITICAL **: gst_event_parse_stream_start: assertion `GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START' failed
<GstEvent at 0x7fc7b401eb00>
None

(transmageddon.py:14655): GStreamer-CRITICAL **: gst_event_parse_stream_start: assertion `GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START' failed
<GstEvent at 0x7fc7b401eb00>
None
<GstEvent at 0x23a1d20>
316219e736e3faa85c7d959cf09f7ba4001c84f4a39c6a5d1fd579054e7e7c32/22206b36

(transmageddon.py:14655): GStreamer-CRITICAL **: gst_event_parse_stream_start: assertion `GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START' failed
<GstEvent at 0x7fc7b401eb00>
None
*** glibc detected *** python3: double free or corruption (fasttop): 0x00007fc7ac01a920 ***

--------
To me it looks like the parse_stream_start doesn't validate properly and resurns the GStreamer-CRITICAL instead of a False. Not sure what the crash at the end is about.
Comment 1 Tim-Philipp Müller 2012-11-23 13:44:02 UTC
Perhaps after event=Gst.PadProbeInfo.get_event(probeinfo) you should first check what kind (type) of event you got, or if you got None.
Comment 2 Christian Fredrik Kalager Schaller 2012-11-23 17:34:25 UTC
Want to try checking for event type first, but the GST_EVENT_TYPE(event) doesn't seem to exist from Python.
Comment 3 Nicolas Dufresne (ndufresne) 2012-11-23 18:00:07 UTC
event.type should work, we do this for GstMessage in PiTiVi.
Comment 4 Christian Fredrik Kalager Schaller 2012-11-23 18:47:45 UTC
ok, so the code is now:
event=Gst.PadProbeInfo.get_event(probeinfo)
       eventtype=event.type
       if eventtype==Gst.EventType.STREAM_START:
           streamid=Gst.Event.parse_stream_start(event)
           print(event)
           print(streamid)

But I am still getting an error:
Traceback (most recent call last):
  • File "/home/cschalle/devel/transmageddon/src/transcoder_engine.py", line 337 in padprobe
    streamid=Gst.Event.parse_stream_start(event)
  • File "/usr/lib64/python3.2/site-packages/gi/types.py", line 43 in function
    return info.invoke(*args, **kwargs)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 1: invalid start byte

Comment 5 Christian Fredrik Kalager Schaller 2012-11-23 18:58:58 UTC
GST_DEBUG log:
http://uraeus.fedorapeople.org/files/out.txt.bz2
Comment 6 Christian Fredrik Kalager Schaller 2012-11-23 19:30:27 UTC
The debug log shows the case where we get the UTF-8 error. The input file is an mp4 file with H264 and AAC audio.
Comment 7 Christian Fredrik Kalager Schaller 2012-11-23 20:20:48 UTC
ok, false positive from not returning anything from the callback. With Alessandros fix now committed I am closing this as fixed.