[Bug 774983] avdec_h264 is not copying metadata to the outputbuffer

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Nov 24 07:55:23 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=774983

--- Comment #3 from parithi <parithi at gmail.com> ---
(In reply to Sebastian Dröge (slomo) from comment #2)
> Can you provide a testcase that allows reproducing this problem? Are you
> certain that this warning comes from avdec_h264 and not your h264parse
> changes (try running with G_DEBUG=fatal_warnings and get a backtrace of that
> warning)?

Sebastian,

The test case is, I have created a metadata with custom SEI message that needs
to be added after encode.

The "GStreamer-CRITICAL" message is from gst_buffer_add_h264_meta() function.
This function uses the buffer sent through gst_video_decoder_finish_frame().
Please refer below gdb back trace.

************************************

G_DEBUG=fatal_warnings gdb --args  gst-launch-1.0 filesrc location=in.ts !
tsdemux ! h264parse ! 'video/x-h264, stream-format=byte-stream' ! avdec_h264 !
x264enc ! mpegtsmux ! filesink location=out.ts

(gdb) r
Starting program: /usr/local/bin/gst-launch-1.0 filesrc location=in.ts \!
tsdemux \! h264parse \! video/x-h264,\ stream-format=byte-stream \! avdec_h264
\! x264enc \! mpegtsmux \! filesink location=out.ts
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
Redistribute latency...
Redistribute latency...

(gst-launch-1.0:20583): GStreamer-CRITICAL **: gst_buffer_add_meta: assertion
'gst_buffer_is_writable (buffer)' failed

Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 0x7fffebb75700 (LWP 20587)]
0x00007ffff70728d3 in g_logv () from /usr/lib64/libglib-2.0.so.0
Missing separate debuginfos, use: debuginfo-install
gstreamer-1.8.1-0.el7.centos.x86_64
(gdb) bt
#0  0x00007ffff70728d3 in g_logv () at /usr/lib64/libglib-2.0.so.0
#1  0x00007ffff7072a4f in g_log () at /usr/lib64/libglib-2.0.so.0
#2  0x00007ffff7aedf0a in gst_buffer_add_meta
(buffer=buffer at entry=0x7fffe4039450, info=0x7fffe4015630,
params=params at entry=0x0) at gstbuffer.c:2161
#3  0x00007fffeef5033f in gst_buffer_add_h264_meta
(buffer=buffer at entry=0x7fffe4039450, length=328, payload=0x7fffe41a2910) at
gsth264meta.c:96
#4  0x00007fffeef503ce in gst_h264_meta_transform (transbuf=0x7fffe4039450,
meta=0x7fffe403ba08, buffer=<optimized out>, type=<optimized out>,
data=<optimized out>) at gsth264meta.c:30
#5  0x00007fffeef3eb4a in foreach_metadata (inbuf=0x7fffe4768190,
meta=0x7fffebb73bf8, user_data=<optimized out>) at gstvideodecoder.c:2931
#6  0x00007ffff7aee219 in gst_buffer_foreach_meta (buffer=0x7fffe4768190,
func=func at entry=
    0x7fffeef3e9f0 <foreach_metadata>,
user_data=user_data at entry=0x7fffebb73c70) at gstbuffer.c:2311
#7  0x00007fffeef40f50 in gst_video_decoder_finish_frame
(decoder=decoder at entry=0x8490d0, frame=frame at entry=0x7fffe47682a0) at
gstvideodecoder.c:3022
#8  0x00007fffecd7eb19 in gst_ffmpegviddec_frame (ret=0x7fffebb73eec,
frame=<optimized out>, have_data=0x7fffebb73ee8, size=3832973840, data=0x0,
ffmpegdec=0x8490d0) at gstavviddec.c:1487
#9  0x00007fffecd7eb19 in gst_ffmpegviddec_frame
(ffmpegdec=ffmpegdec at entry=0x8490d0, data=data at entry=0x7fffe403c400 "",
size=size at entry=697, have_data=have_data at entry=0x7fffebb73ee8,
frame=frame at entry=0x7fffe4768a10, ret=ret at entry=0x7fffebb73eec) at
gstavviddec.c:1548
#10 0x00007fffecd7f420 in gst_ffmpegviddec_handle_frame (decoder=0x8490d0,
frame=0x7fffe4768a10) at gstavviddec.c:1679
#11 0x00007fffeef395f8 in gst_video_decoder_decode_frame
(decoder=decoder at entry=0x8490d0, frame=0x7fffe4768a10) at
gstvideodecoder.c:3389
#12 0x00007fffeef3be3c in gst_video_decoder_chain_forward
(decoder=decoder at entry=0x8490d0, buf=buf at entry=0x7fffe4013b50,
at_eos=at_eos at entry=0)
    at gstvideodecoder.c:2131
#13 0x00007fffeef3c403 in gst_video_decoder_chain (pad=pad at entry=0x7e6950,
parent=parent at entry=0x8490d0, buf=buf at entry=0x7fffe4013b50)
    at gstvideodecoder.c:2443
#14 0x00007ffff7b21575 in gst_pad_push_data (data=0x7fffe4013b50,
type=<optimized out>, pad=0x7e6950) at gstpad.c:4205
#15 0x00007ffff7b21575 in gst_pad_push_data (pad=pad at entry=0x7e7910,
type=type at entry=4112, data=<optimized out>, data at entry=0x7fffe4013b50)
    at gstpad.c:4457
#16 0x00007ffff7b2945e in gst_pad_push (pad=0x7e7910, buffer=0x7fffe4013b50) at
gstpad.c:4576
#17 0x00007fffefa86658 in gst_base_transform_chain (pad=pad at entry=0x7e76d0,
parent=parent at entry=0x86e180, buffer=buffer at entry=0x7fffe4013b50)
    at gstbasetransform.c:2369
#18 0x00007ffff7b21575 in gst_pad_push_data (data=0x7fffe4013b50,
type=<optimized out>, pad=0x7e76d0) at gstpad.c:4205
#19 0x00007ffff7b21575 in gst_pad_push_data (pad=pad at entry=0x7e6710,
type=type at entry=4112, data=<optimized out>, data at entry=0x7fffe4013b50)
    at gstpad.c:4457
#20 0x00007ffff7b2945e in gst_pad_push (pad=0x7e6710,
buffer=buffer at entry=0x7fffe4013b50) at gstpad.c:4576
#21 0x00007fffefa6aef9 in gst_base_parse_push_frame
(parse=parse at entry=0x806540, frame=frame at entry=0x7fffe4761a30) at
gstbaseparse.c:2543
#22 0x00007fffefa6ef33 in gst_base_parse_finish_frame (frame=0x7fffe4761a30,
parse=0x806540) at gstbaseparse.c:2360
#23 0x00007fffefa6ef33 in gst_base_parse_finish_frame
(parse=parse at entry=0x806540, frame=frame at entry=0x7fffe4761a30,
size=size at entry=696)
    at gstbaseparse.c:2701
#24 0x00007fffee3ad5e9 in gst_h264_parse_handle_frame (parse=0x806540,
frame=0x7fffe4761a30, skipsize=0x7fffebb7494c) at gsth264parse.c:1257
#25 0x00007fffefa68310 in gst_base_parse_handle_buffer
(parse=parse at entry=0x806540, buffer=<optimized out>,

*************************************************

If I make the buffer writable as suggested by Matthew, getting following error.

(gst-launch-1.0:9874): GStreamer-CRITICAL **: gst_mini_object_unref: assertion
'mini_object->refcount > 0' failed

** (gst-launch-1.0:9874): CRITICAL **: gst_video_frame_map_id: assertion
'GST_IS_BUFFER (buffer)' failed
ERROR: from element /GstPipeline:pipeline0/avdec_h264:avdec_h264-0: Cannot
access memory for read and write operation.
Additional debug info:
gstavviddec.c(865): gst_ffmpegviddec_get_buffer2 ():
/GstPipeline:pipeline0/avdec_h264:avdec_h264-0:
The video memory allocated from downstream pool could not mapped forread and
write.
Execution ended after 0:00:00.3756


Regards,
Parithi

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list