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 580810 - Stuttering and crash with some H.264 files
Stuttering and crash with some H.264 files
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other Linux
: Normal normal
: 0.10.11
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-29 21:20 UTC by Mikko Rasa
Modified: 2010-08-06 12:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mikko Rasa 2009-04-29 21:20:15 UTC
I have a few Matroska files containing H.264 video and AAC audio which cause severe hiccups and finally an abort, with the following message:

ERROR               ffmpeg :0:: Internal error, picture buffer overflow

Backtrace from the abort is:

  • #0 __kernel_vsyscall
  • #1 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #2 *__GI_abort
    at abort.c line 88
  • #3 MPV_frame_start
    at libavcodec/mpegvideo.c line 807
  • #4 frame_start
    at libavcodec/h264.c line 2227
  • #5 decode_slice_header
    at libavcodec/h264.c line 3856
  • #6 decode_nal_units
    at libavcodec/h264.c line 7500
  • #7 decode_frame
    at libavcodec/h264.c line 7701
  • #8 avcodec_decode_video
    at libavcodec/utils.c line 529
  • #9 gst_ffmpegdec_frame
    at gstffmpegdec.c line 1537
  • #10 gst_ffmpegdec_chain
    at gstffmpegdec.c line 2371
  • #11 gst_pad_chain_unchecked
    at gstpad.c line 3977
  • #12 gst_pad_push
    at gstpad.c line 4144
  • #13 gst_matroska_demux_parse_blockgroup_or_simpleblock
    at matroska-demux.c line 4281
  • #14 gst_matroska_demux_loop
    at matroska-demux.c line 4344
  • #15 gst_task_func
    at gsttask.c line 172

I have put the beginning of one such file (8MB) on my webserver at:

http://www.tdb.fi/~tdb/GH13.mkv

It's the beginning of Ghost Hound episode 13, as fansubbed by Shinsen-Subs.  Please think before downloading, I only have 1Mbit upstream and I hope to not get it bogged.  The crash can be obtained with:

gst-launch-0.10 filesrc location=GH13.mkv ! matroskademux ! ffdec_h264 ! appsink sync=false

The sync=false is optional, but makes it reach the crash point much faster (6 seconds vs. a minute).
Comment 1 palfrey 2009-04-30 15:48:37 UTC
This looks to be one of the following upstream FFMPEG bugs (all of which are reported as "fixed" in current SVN)

https://roundup.ffmpeg.org/roundup/ffmpeg/issue334
https://roundup.ffmpeg.org/roundup/ffmpeg/issue335
https://roundup.ffmpeg.org/roundup/ffmpeg/issue336
https://roundup.ffmpeg.org/roundup/ffmpeg/issue337

Judging from comments in the bugs, the fix *might* be as simple as applying http://git.ffmpeg.org/?p=ffmpeg;a=commitdiff;h=960369c0a41c84ecd0130ce127fbe80a05b25da9 (or it may well depend on a bunch of stuff before that, or possibly gstreamer's copy of ffmpeg might be significantly out of sync, rendering it not applicable)
Comment 2 Mikko Rasa 2009-04-30 16:28:35 UTC
The patch does not apply as is; furthermore, it seems that it is already included in gst-ffmpeg's snapshot of ffmpeg, with some additional changes.

I tried updating ffmpeg to the latest svn version, but that didn't change anything at all.

When running with xvimagesink, I also get a bunch of these:

ERROR               ffmpeg :0:: number of reference frames exceeds max (probably corrupt input), discarding one

I can't see any connection to either of the problems though.
Comment 3 Wim Taymans 2009-06-05 11:34:33 UTC
QoS seems to make ffmpeg fail. diabling qos on the videosink makes this file play back perfectly. I'll see why it's happening. 
Comment 4 Wim Taymans 2009-06-05 11:49:32 UTC
matroskademux was sending segment updates that caused output timestamps to fall outside of the clipping region and this caused QoS to drop frames and mess up the ffmpeg state.

commit 608a920771e698d5a43f8c4f800e57173a9165e8
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Fri Jun 5 13:47:15 2009 +0200

    ffmpegdec: don't do QoS on invalid timestamps
    
    When we convert the timestamp to running_time, don't try to do QoS on invalid
    times.
    
    Fixes #580810

Comment 5 Thomas Green 2009-09-08 15:25:34 UTC
I can still reproduce this bug using the 0.10.8 release of gst-ffmpeg, which includes the above fix. Can anyone else confirm? (or perhaps there is something wrong with my set-up?).

gstreamer-0.10.24
gst-plugins-bad-0.10.14
gst-plugins-base-0.10.24
gst-plugins-good-0.10.16
gst-plugins-ugly-0.10.12
gst-plugins-ffmpeg-0.10.8

The original sample file still aborts for me (not always at the same point), along with the occasional stuttering, and disabling qos on the video sink doesn't seem to help.
Comment 6 Sebastian Dröge (slomo) 2009-09-09 13:34:35 UTC
I can confirm that it doesn't work with latest GIT although Wim's commit is there and our internal ffmpeg copy also has all changes that Tim referenced above.

It's stuttering and aborting after some time with:
0:00:56.875466287 18243       0xcd2ae0 ERROR                 ffmpeg :0:: Internal error, picture buffer overflow
Abgebrochen


Backtrace:

  • #0 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #1 *__GI_abort
    at abort.c line 88
  • #2 ff_find_unused_picture
    at libavcodec/mpegvideo.c line 807
  • #3 MPV_frame_start
    at libavcodec/mpegvideo.c line 868
  • #4 frame_start
    at libavcodec/h264.c line 2227
  • #5 decode_slice_header
    at libavcodec/h264.c line 3856
  • #6 decode_nal_units
    at libavcodec/h264.c line 7500
  • #7 decode_frame
    at libavcodec/h264.c line 7701
  • #8 avcodec_decode_video
    at libavcodec/utils.c line 529
  • #9 gst_ffmpegdec_video_frame
    at gstffmpegdec.c line 1669
  • #10 gst_ffmpegdec_frame
    at gstffmpegdec.c line 2141
  • #11 gst_ffmpegdec_chain
    at gstffmpegdec.c line 2555
  • #12 gst_pad_chain_data_unchecked
    at gstpad.c line 4042
  • #13 gst_pad_push_data
    at gstpad.c line 4271
  • #14 gst_single_queue_push_one
    at gstmultiqueue.c line 806
  • #15 gst_multi_queue_loop
    at gstmultiqueue.c line 978
  • #16 gst_task_func
    at gsttask.c line 234
  • #17 g_thread_pool_thread_proxy
    at /tmp/buildd/glib2.0-2.21.6/glib/gthreadpool.c line 265
  • #18 g_thread_create_proxy
    at /tmp/buildd/glib2.0-2.21.6/glib/gthread.c line 635
  • #19 start_thread
    at pthread_create.c line 300
  • #20 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 112
  • #21 ??

Comment 7 Tim-Philipp Müller 2010-08-06 12:43:42 UTC
This works fine for me with current git, both in playbin/totem and with fakesink sync=false.

Please re-open if you can still reproduce it.