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 697617 - gst-libav renders incorrectly in multithread mode
gst-libav renders incorrectly in multithread mode
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
1.0.6
Other Linux
: Normal blocker
: 1.0.7
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-04-09 08:29 UTC by cee1
Modified: 2013-04-23 12:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screen shot of the incorrect rendered frame (81.63 KB, image/png)
2013-04-09 08:30 UTC, cee1
Details

Description cee1 2013-04-09 08:29:36 UTC
gst-launch-1.0 filesrc location=big_buck_bunny_480p_h264.mov ! qtdemux name=qt qt.video_0 ! avdec_h264 max-threads=4 ! autovideosink

The above command produces incorrect frame(see the screenshot in attachment) for the famous "big buck bunny".

While with ffplay(from libav), it works fine in multithread mode:
ffplay -threads 4 big_buck_bunny_480p_h264.mov

--------
More information(on a dual core CPU):
$ gst-inspect-1.0 avdec_h264
Factory Details:
  Rank:		primary (256)
  Long-name:		libav H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 decoder
  Klass:		Codec/Decoder/Video
  Description:		libav h264 decoder
  Author:		Wim Taymans <wim.taymans@gmail.com>, Ronald Bultje <rbultje@ronald.bitfreak.net>, Edward Hervey <bilboed@bilboed.com>

Plugin Details:
  Name:			libav
  Description:		All libav codecs and formats (local snapshot)
  Filename:		/usr/lib64/gstreamer-1.0/libgstlibav.so
  Version:		1.0.6
  License:		GPL
  Source module:	gst-libav
  Binary package:	libav
  Origin URL:		http://www.libav.org

$ gst-inspect-1.0 qtdemux
Factory Details:
  Rank:		primary (256)
  Long-name:		QuickTime demuxer
  Klass:		Codec/Demuxer
  Description:		Demultiplex a QuickTime file into audio and video streams
  Author:		David Schleef <ds@schleef.org>, Wim Taymans <wim@fluendo.com>

Plugin Details:
  Name:			isomp4
  Description:		ISO base media file format support (mp4, 3gpp, qt, mj2)
  Filename:		/usr/lib64/gstreamer-1.0/libgstisomp4.so
  Version:		1.0.6
  License:		LGPL
  Source module:	gst-plugins-good
  Source release date:	2013-03-22
  Binary package:	Fedora GStreamer-plugins-good package
  Origin URL:		http://download.fedoraproject.org
Comment 1 cee1 2013-04-09 08:30:57 UTC
Created attachment 241022 [details]
Screen shot of the incorrect rendered frame
Comment 2 Tim-Philipp Müller 2013-04-09 08:49:48 UTC
Could you provide a link to the exact input file used?
Comment 4 Tim-Philipp Müller 2013-04-09 22:00:07 UTC
Thanks & sigh, maybe we should just disable multi-threaded decoding entirely in 1.0.x - it works fine with the newer libav in git master.
Comment 5 cee1 2013-04-10 07:57:08 UTC
For 1.0.x, it seems be caused by setting threads to FF_THREAD_SLICE type(See #697690).
Comment 6 Tim-Philipp Müller 2013-04-21 11:09:32 UTC
Marking as blocker for 1.0.7 for now - we should try to fix it somehow, and if it's by simply disabling multi-threaded decoding at all (and let people know it works fine in git master).

I don't know if even setting it to FF_THREAD_FRAME fixes it completely, I believe Sebastian mentioned some remaining issues on Windows.
Comment 7 Sebastian Dröge (slomo) 2013-04-22 07:40:22 UTC
I tried setting the threading to 0 and it still happens. Unfortunately this is only 0.10 as the only stream I have to reproduce this is a GDP stream... and muxing it to anything else makes the crash go away.


Program received signal SIGSEGV, Segmentation fault.

Thread 140737333872384 (LWP 6011)

  • #0 decode_slice_header
    at libavcodec/h264.c line 2927
  • #1 decode_nal_units
    at libavcodec/h264.c line 3966
  • #2 decode_frame
    at libavcodec/h264.c line 4184
  • #3 avcodec_decode_video2
    at libavcodec/utils.c line 1152
  • #4 gst_ffmpegdec_video_frame
    at gstffmpegdec.c line 1769
  • #5 gst_ffmpegdec_frame
    at gstffmpegdec.c line 2286
  • #6 gst_ffmpegdec_chain
    at gstffmpegdec.c line 2733
  • #7 gst_pad_push
    at gstpad.c line 4715
  • #8 gst_base_transform_chain
    at gstbasetransform.c line 2687
  • #9 gst_pad_push
    at gstpad.c line 4715
  • #10 gst_base_parse_push_frame
    at gstbaseparse.c line 1967
  • #11 gst_base_parse_chain
    at gstbaseparse.c line 2303
  • #12 gst_h264_parse_chain
    at gsth264parse.c line 1988
  • #13 gst_pad_push
    at gstpad.c line 4715
  • #14 gst_type_find_element_chain
    at gsttypefindelement.c line 771
  • #15 gst_pad_push
    at gstpad.c line 4715
  • #16 gst_pad_push
    at gstpad.c line 4715
  • #17 gst_gdp_depay_chain
    at gstgdpdepay.c line 328
  • #18 gst_pad_push
    at gstpad.c line 4715
  • #19 gst_base_src_loop
    at gstbasesrc.c line 2567
  • #20 gst_task_func
    at gsttask.c line 327
  • #21 g_thread_pool_thread_proxy
    from /home/slomo/Projects/gstreamer/gst-sdk/cerbero/dist/linux/lib/libglib-2.0.so.0
  • #22 g_thread_proxy
    from /home/slomo/Projects/gstreamer/gst-sdk/cerbero/dist/linux/lib/libglib-2.0.so.0
  • #23 start_thread
    at pthread_create.c line 311
  • #24 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 113

Comment 8 Sebastian Dröge (slomo) 2013-04-22 07:44:00 UTC
So this is probably a different problem, completely unrelated to the threading in libav
Comment 9 Sebastian Dröge (slomo) 2013-04-22 08:50:26 UTC
See https://bugzilla.gnome.org/show_bug.cgi?id=698546  and this is a) a completely different problem and b) fixes in 1.0 already.

So what should we do here now?
Comment 10 Sebastian Dröge (slomo) 2013-04-23 12:13:08 UTC
commit fb8156d26ca82b4102115b659395eafb8ad9cf1a
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Tue Apr 23 14:12:23 2013 +0200

    avviddec: Disable SLICE based threaded decoding
    
    It causes artifacts in libav 0.8 and seems to be broken.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698649

commit ad6562eadd0ef9279781505b2c3e6ea6933edc6c
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Tue Apr 23 14:10:54 2013 +0200

    avviddec: Enable FRAME based threaded decoding if upstream is not live
    
    If upstream is live we don't want FRAME based threaded decoding as
    it adds latency.