msdk: msdkenc/dec with videoconvert causes crash
- OS: CentOS Linux release 7.4.1708
- gst-version: master (1.16 also same)
command
GST_DEBUG=msdk*:6 gst-launch-1.0 filesrc location=trailer.mp4 ! qtdemux ! h264parse ! msdkh264dec ! videoconvert ! videoscale ! videoconvert ! videorate ! video/x-raw,width=1920,height=1080,framerate=60/1 ! msdkh264enc bitrate=6000 gop-size=60 ! h264parse ! mp4mux ! filesink location=1080_avc.mp4
The test file is well known sintel trailer https://www.w3.org/2010/05/video/mediaevents.html
callstack
#0 0x00007f30e1990279 in waitpid () at /lib64/libpthread.so.0
#1 0x00007f30e1e0d923 in g_on_error_stack_trace () at /lib64/libglib-2.0.so.0
#2 0x0000000000403885 in fault_spin ()
#3 0x0000000000403860 in fault_handler_sighandler (signum=11)
#4 0x00007f30e19906d0 in <signal handler called> () at /lib64/libpthread.so.0
#5 0x00007f30d83b4663 in gst_msdk_context_put_surface_available (context=0x2397850, resp=0x2382ee0, surface=0x7f30c4004320)
#6 0x00007f30d83c4630 in gst_msdk_video_memory_release_surface (mem=0x238e3a0)
#7 0x00007f30d83b338e in gst_msdk_buffer_pool_release_buffer (pool=0x7f30c424e4d0, buf=0x7f30c432da20)
#8 0x00007f30e21590c8 in gst_buffer_pool_release_buffer (pool=0x7f30c424e4d0, buffer=0x7f30c432da20) at ../subprojects/gstreamer/gst/gstbufferpool.c:1364
#9 0x00007f30e2151a44 in _gst_buffer_dispose (buffer=0x7f30c432da20)
#10 0x00007f30e219824a in gst_mini_object_unref (mini_object=0x7f30c432da20)
#11 0x00007f30d5327191 in gst_buffer_unref (buf=0x7f30c432da20)
#12 0x00007f30d5328e47 in gst_video_rate_swap_prev (videorate=0x237ded0, buffer=0x0, time=0)
#13 0x00007f30d53286eb in gst_video_rate_reset (videorate=0x237ded0)
#14 0x00007f30d532d1f1 in gst_video_rate_stop (trans=0x237ded0)
#15 0x00007f30da06bf92 in gst_base_transform_activate (trans=0x237ded0, active=0) at ../subprojects/gstreamer/libs/gst/base/gstbasetransform.c:2445
#16 0x00007f30da06bff9 in gst_base_transform_sink_activate_mode (pad=0x2339d30, parent=0x237ded0, mode=GST_PAD_MODE_PUSH, active=0)
#17 0x00007f30e219badc in activate_mode_internal (pad=0x2339d30, parent=0x237ded0, mode=GST_PAD_MODE_PUSH, active=0)
#18 0x00007f30e219b62e in gst_pad_set_active (pad=0x2339d30, active=0)
#19 0x00007f30e217b54a in activate_pads (vpad=0x7ffdd4f19f10, ret=0x7ffdd4f19f60, active=0x7ffdd4f19fa4) at ../subprojects/gstreamer/gst/gstelement.c:3121
#20 0x00007f30e218f2f2 in gst_iterator_fold (it=0x21d2da0, func=0x7f30e217b50b <activate_pads>, ret=0x7ffdd4f19f60, user_data=0x7ffdd4f19fa4)
#21 0x00007f30e217b5de in iterator_activate_fold_with_resync (iter=0x21d2da0, func=0x7f30e217b50b <activate_pads>, user_data=0x7ffdd4f19fa4)
#22 0x00007f30e217b722 in gst_element_pads_activate (element=0x237ded0, active=0) at ../subprojects/gstreamer/gst/gstelement.c:3189
#23 0x00007f30e217ba14 in gst_element_change_state_func (element=0x237ded0, transition=GST_STATE_CHANGE_PAUSED_TO_READY)
#24 0x00007f30e217b077 in gst_element_change_state (element=0x237ded0, transition=GST_STATE_CHANGE_PAUSED_TO_READY)
#25 0x00007f30e217ae16 in gst_element_set_state_func (element=0x237ded0, state=GST_STATE_NULL) at ../subprojects/gstreamer/gst/gstelement.c:2987
#26 0x00007f30e217aa04 in gst_element_set_state (element=0x237ded0, state=GST_STATE_NULL) at ../subprojects/gstreamer/gst/gstelement.c:2888
#27 0x00007f30e214a3a9 in gst_bin_element_set_state (bin=0x2390060, element=0x237ded0, base_time=0, start_time=0, current=GST_STATE_READY, next=GST_STATE_NULL)
#28 0x00007f30e214b99e in gst_bin_change_state_func (element=0x2390060, transition=GST_STATE_CHANGE_READY_TO_NULL)
#29 0x00007f30e21afceb in gst_pipeline_change_state (element=0x2390060, transition=GST_STATE_CHANGE_READY_TO_NULL)
#30 0x00007f30e217b077 in gst_element_change_state (element=0x2390060, transition=GST_STATE_CHANGE_READY_TO_NULL)
#31 0x00007f30e217ae16 in gst_element_set_state_func (element=0x2390060, state=GST_STATE_NULL) at ../subprojects/gstreamer/gst/gstelement.c:2987
#32 0x00007f30e217aa04 in gst_element_set_state (element=0x2390060, state=GST_STATE_NULL) at ../subprojects/gstreamer/gst/gstelement.c:2888
#33 0x0000000000406930 in main (argc=30, argv=0x7ffdd4f1aa18)
Spinning. Please run 'gdb gst-launch-1.0 23945' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.
log
0:00:00.024847773 23945 0x2347d90 INFO msdk msdk.c:195:msdk_open_session: MSDK implementation: 0x0402 (HARDWARE)
0:00:00.024870468 23945 0x2347d90 INFO msdk msdk.c:196:msdk_open_session: MSDK version: 1.25
Setting pipeline to PAUSED ...
0:00:00.064192373 23945 0x2347d90 INFO msdk msdk.c:195:msdk_open_session: MSDK implementation: 0x0402 (HARDWARE)
0:00:00.064209180 23945 0x2347d90 INFO msdk msdk.c:196:msdk_open_session: MSDK version: 1.25
0:00:00.064401706 23945 0x2347d90 DEBUG msdkcontext gstmsdkcontext.c:108:get_device_id: Opened the drm device node /dev/dri/renderD128
libva info: VA-API version 1.0.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
0:00:00.066467509 23945 0x2347d90 INFO msdkenc gstmsdkenc.c:1444:gst_msdkenc_start:<msdkh264enc0> Creating new context <msdkcontext0>
0:00:00.066542038 23945 0x2347d90 INFO msdkdec gstmsdkdec.c:670:gst_msdkdec_start:<msdkh264dec0> Found context <msdkcontext0> from neighbour
Pipeline is PREROLLING ...
Got context from element 'msdkh264enc0': gst.msdk.Context=context, gst.msdk.Context=(GstMsdkContext)"\(GstMsdkContext\)\ msdkcontext0";
0:00:00.174898618 23945 0x23704f0 INFO msdkdec gstmsdkdec.c:589:gst_msdkdec_set_latency:<msdkh264dec0> Updating latency to 0:00:00.041666667 (1 frames)
Redistribute latency...
0:00:00.175012739 23945 0x23704f0 INFO msdkdec gstmsdkdec.c:928:gst_msdkdec_handle_frame:<msdkh264dec0> mfxBitStream=> DataLength:812 DataOffset:0 MaxLength:812
0:00:00.175268762 23945 0x23704f0 DEBUG msdkdec gstmsdkdec.c:795:gst_msdkdec_negotiate:<msdkh264dec0> Start Negotiating caps, pool and Init the msdk decdoer subsystem
0:00:00.192905406 23945 0x23704f0 INFO msdkdec gstmsdkdec.c:553:gst_msdkdec_set_src_caps:<msdkh264dec0> new alloc caps = video/x-raw, format=(string)NV12, width=(int)864, height=(int)480, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)bt601, framerate=(fraction)24/1
0:00:00.203248266 23945 0x23704f0 INFO msdkenc gstmsdkenc.c:1067:gst_msdkenc_set_format:<msdkh264enc0> This MSDK encoder uses video memory
0:00:00.221997642 23945 0x23704f0 DEBUG msdkenc gstmsdkenc.c:489:gst_msdkenc_init_encoder:<msdkh264enc0> Required 5 surfaces (5 suggested), allocated 5
0:00:00.229276978 23945 0x23704f0 DEBUG msdkenc gstmsdkenc.c:898:gst_msdkenc_set_src_caps:<msdkh264enc0> output caps: video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)high, level=(string)4.2
0:00:00.229426221 23945 0x23704f0 INFO msdkenc gstmsdkenc.c:837:gst_msdkenc_set_latency:<msdkh264enc0> Updating latency to 0:00:00.066666667 (4 frames)
Redistribute latency...
0:00:00.229607845 23945 0x23704f0 INFO msdkdec gstmsdkdec.c:310:gst_msdkdec_init_decoder:<msdkh264dec0> This MSDK decoder uses video memory
0:00:00.229703490 23945 0x23704f0 DEBUG msdkdec gstmsdkdec.c:399:gst_msdkdec_init_decoder:<msdkh264dec0> Required 7 surfaces (14 suggested)
0:00:00.230351426 23945 0x23704f0 INFO msdkdec gstmsdkdec.c:1257:gst_msdkdec_decide_allocation:<msdkh264dec0> create new MSDK bufferpool
0:00:00.230474752 23945 0x23704f0 LOG msdkdec gstmsdkdec.c:116:gst_msdkdec_get_oldest_frame:<msdkh264dec0> Oldest frame is 0 0:00:00.083333333 and 0 frames left
0:00:00.230674675 23945 0x23704f0 INFO msdkdec gstmsdkdec.c:928:gst_msdkdec_handle_frame:<msdkh264dec0> mfxBitStream=> DataLength:30 DataOffset:0 MaxLength:30
0:00:00.230691207 23945 0x23704f0 LOG msdkdec gstmsdkdec.c:116:gst_msdkdec_get_oldest_frame:<msdkh264dec0> Oldest frame is 0 0:00:00.083333333 and 1 frames left
0:00:00.230778104 23945 0x23704f0 INFO msdkdec gstmsdkdec.c:928:gst_msdkdec_handle_frame:<msdkh264dec0> mfxBitStream=> DataLength:35 DataOffset:0 MaxLength:35
0:00:00.230793250 23945 0x23704f0 LOG msdkdec gstmsdkdec.c:116:gst_msdkdec_get_oldest_frame:<msdkh264dec0> Oldest frame is 0 0:00:00.083333333 and 2 frames left
0:00:00.231437782 23945 0x23704f0 INFO msdkdec gstmsdkdec.c:928:gst_msdkdec_handle_frame:<msdkh264dec0> mfxBitStream=> DataLength:36 DataOffset:0 MaxLength:36
0:00:00.231455619 23945 0x23704f0 LOG msdkdec gstmsdkdec.c:116:gst_msdkdec_get_oldest_frame:<msdkh264dec0> Oldest frame is 0 0:00:00.083333333 and 3 frames left
0:00:00.231930375 23945 0x23704f0 INFO msdkdec gstmsdkdec.c:928:gst_msdkdec_handle_frame:<msdkh264dec0> mfxBitStream=> DataLength:36 DataOffset:0 MaxLength:36
0:00:00.231948098 23945 0x23704f0 LOG msdkdec gstmsdkdec.c:116:gst_msdkdec_get_oldest_frame:<msdkh264dec0> Oldest frame is 0 0:00:00.083333333 and 4 frames left
0:00:00.232267638 23945 0x23704f0 INFO msdkdec gstmsdkdec.c:928:gst_msdkdec_handle_frame:<msdkh264dec0> mfxBitStream=> DataLength:37 DataOffset:0 MaxLength:37
0:00:00.232284756 23945 0x23704f0 LOG msdkdec gstmsdkdec.c:116:gst_msdkdec_get_oldest_frame:<msdkh264dec0> Oldest frame is 0 0:00:00.083333333 and 5 frames left
0:00:00.232606543 23945 0x23704f0 INFO msdkdec gstmsdkdec.c:928:gst_msdkdec_handle_frame:<msdkh264dec0> mfxBitStream=> DataLength:37 DataOffset:0 MaxLength:37
0:00:00.232623230 23945 0x23704f0 LOG msdkdec gstmsdkdec.c:116:gst_msdkdec_get_oldest_frame:<msdkh264dec0> Oldest frame is 0 0:00:00.083333333 and 6 frames left
0:00:00.232949722 23945 0x23704f0 INFO msdkdec gstmsdkdec.c:928:gst_msdkdec_handle_frame:<msdkh264dec0> mfxBitStream=> DataLength:37 DataOffset:0 MaxLength:37
0:00:00.232968456 23945 0x23704f0 LOG msdkdec gstmsdkdec.c:116:gst_msdkdec_get_oldest_frame:<msdkh264dec0> Oldest frame is 0 0:00:00.083333333 and 7 frames left
0:00:00.233434851 23945 0x23704f0 LOG msdkdec gstmsdkdec.c:116:gst_msdkdec_get_oldest_frame:<msdkh264dec0> Oldest frame is 0 0:00:00.083333333 and 7 frames left
0:00:00.519106425 23945 0x23704f0 LOG msdkdec gstmsdkdec.c:116:gst_msdkdec_get_oldest_frame:<msdkh264dec0> Oldest frame is 1 0:00:00.125000000 and 6 frames left
0:00:00.519214227 23945 0x23704f0 INFO msdkdec gstmsdkdec.c:928:gst_msdkdec_handle_frame:<msdkh264dec0> mfxBitStream=> DataLength:37 DataOffset:0 MaxLength:37
0:00:00.519230819 23945 0x23704f0 LOG msdkdec gstmsdkdec.c:116:gst_msdkdec_get_oldest_frame:<msdkh264dec0> Oldest frame is 1 0:00:00.125000000 and 7 frames left
0:00:00.519564589 23945 0x23704f0 LOG msdkdec gstmsdkdec.c:116:gst_msdkdec_get_oldest_frame:<msdkh264dec0> Oldest frame is 1 0:00:00.125000000 and 7 frames left
0:00:00.830187724 23945 0x23704f0 ERROR default video-frame.c:168:gst_video_frame_map_id: failed to map video frame plane 0
0:00:00.830206053 23945 0x23704f0 ERROR msdkenc gstmsdkenc.c:1257:gst_msdkenc_get_surface_from_frame:<msdkh264enc0> failed to map the frame for source
0:00:00.830214028 23945 0x23704f0 ERROR msdkenc gstmsdkenc.c:1393:gst_msdkenc_handle_frame:<msdkh264enc0> Surface pool is full
0:00:00.830300617 23945 0x23704f0 LOG msdkdec gstmsdkdec.c:116:gst_msdkdec_get_oldest_frame:<msdkh264dec0> Oldest frame is 2 0:00:00.166666666 and 5 frames left
ERROR: from element /GstPipeline:pipeline0/GstQTDemux:qtdemux0: Internal data stream error.
Additional debug info:
../subprojects/gst-plugins-good/gst/isomp4/qtdemux.c(6657): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstQTDemux:qtdemux0:
streaming stopped, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
0:00:00.830466323 23945 0x2347d90 DEBUG msdkenc gstmsdkenc.c:549:gst_msdkenc_close_encoder:<msdkh264enc0> Closing encoder with context <msdkcontext0>
Caught SIGSEGV
0:00:00.832103248 23945 0x23704f0 LOG msdkdec gstmsdkdec.c:116:gst_msdkdec_get_oldest_frame:<msdkh264dec0> Oldest frame is 2 0:00:00.166666666 and 5 frames left
Edited by Seungha Yang