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 796513 - vaapih265dec: segfault when it starts to decode a delta frame
vaapih265dec: segfault when it starts to decode a delta frame
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
1.14.0
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-06-06 13:53 UTC by James Stevenson
Modified: 2018-11-03 15:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
raw byte-stream h265 data that crashes decoder. (32.95 KB, application/octet-stream)
2018-06-07 16:05 UTC, James Stevenson
Details

Description James Stevenson 2018-06-06 13:53:19 UTC
vaapih265dec crashes with an assert failure if stream does not start on keyframe in the i965 driver.

gst-launch-1.0: gen9_mfd.c:649: gen9_hcpd_get_reference_picture_frame_id: Assertion `0' failed.

  • #0 __GI_raise
    at ../sysdeps/unix/sysv/linux/raise.c line 51
  • #1 __GI_abort
    at abort.c line 79
  • #2 __assert_fail_base
    at assert.c line 92
  • #3 __GI___assert_fail
    at assert.c line 101
  • #4 0x00007f13be334b41 in
  • #5 0x00007f13be33649b in
  • #6 vaEndPicture
  • #7 0x00007f13f0507dd3 in
  • #8 0x00007f13f051fb5d in
  • #9 0x00007f13f04fa643 in
  • #10 0x00007f13f04dec52 in
  • #11 gst_video_decoder_decode_frame
    at gstvideodecoder.c line 3416
  • #12 gst_video_decoder_have_frame
    at gstvideodecoder.c line 3348
  • #13 0x00007f13f04dd81a in
  • #14 gst_video_decoder_parse_available
    at gstvideodecoder.c line 882
  • #15 gst_video_decoder_chain_forward
    at gstvideodecoder.c line 2158
  • #16 gst_video_decoder_chain
    at gstvideodecoder.c line 2456
  • #17 gst_pad_chain_data_unchecked
    at gstpad.c line 4279
  • #18 gst_pad_push_data
    at gstpad.c line 4535
  • #19 gst_pad_push
    at gstpad.c line 4654
  • #20 gst_proxy_pad_chain_default
    at gstghostpad.c line 127
  • #21 gst_pad_chain_data_unchecked
    at gstpad.c line 4279
  • #22 gst_pad_push_data
    at gstpad.c line 4535


Example pipeline I am using. I the identity shows the first frame as a delta when the crash happens. However if the first frame is a keyframe it will work correctly deocde and play video.

GST_DEBUG=3 gst-launch-1.0 -v rtspsrc location=<redacted> ! rtph265depay ! h265parse ! identity silent=false ! decodebin ! videoconvert ! xvimagesink

Should the parser not drop data from the stream until a keyframe has passed? I also tried with "h265parse disable-passthrough=true" to try to enable this.

Same video source under both conditions (keyframe/delta as first frame) works fine with the avdec_h265 decoder.
Comment 1 Víctor Manuel Jáquez Leal 2018-06-07 14:57:40 UTC
would be great if you make a stream that starts with a delta frame thus we could replicate the crash easily.

The problem might be in gstreamer-vaapi or in the driver. Not sure yet.
Comment 2 James Stevenson 2018-06-07 16:05:32 UTC
Created attachment 372595 [details]
raw byte-stream h265 data that crashes decoder.


sure I just captured one with the following.

gst-launch-1.0 -v rtspsrc location=<redacted> ! rtph265depay ! h265parse ! video/x-h265, stream-format=byte-stream ! identity silent=false ! filesink location=delta-raw.h265

Then confirmed the crash agin with

gst-launch-1.0 filesrc location=delta-raw.h265 ! h265parse ! decodebin ! fakesink
and
gst-launch-1.0 filesrc location=delta-raw.h265 ! h265parse ! vaapih265dec ! fakesink

Some vainfo output may also be useful if its a driver / hw specific

vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 2.1.0
vainfo: Supported profile and entrypoints
Comment 3 Víctor Manuel Jáquez Leal 2018-06-15 12:12:55 UTC
Hint: I guess the solution is something similar to this patch for H264

https://cgit.freedesktop.org/gstreamer/gstreamer-vaapi/commit/?id=b4e92084

decoder: h264: skip all pictures prior the first I-frame.

Don't try to decode pictures until the first I-frame is received within
the currently active sequence. There is no point is decoding and then
displaying frames with artifacts.
Comment 4 GStreamer system administrator 2018-11-03 15:54:48 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/98.