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 612773 - gst-ffmpeg aborts in ff_find_unused_picture
gst-ffmpeg aborts in ff_find_unused_picture
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: dont know
0.10.28
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 613848 613916 614227 623305 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-03-13 05:37 UTC by steubens
Modified: 2010-10-25 17:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ffmpeg:5 messages from test run (166.64 KB, text/x-log)
2010-03-13 05:37 UTC, steubens
Details

Description steubens 2010-03-13 05:37:40 UTC
Created attachment 156046 [details]
ffmpeg:5 messages from test run

everything built from git current as of the time of this post, and with CFLAGS="-g" for toplevel projects, in addition to --with-ffmpeg-extra-configure="--disable-optimizations" for gst-ffmpeg

log collected, and crash expressed by:
gst-launch --gst-debug="ffmpeg:5" --gst-debug-no-color playbin2 uri=file:`pwd`/\[gg\]_CANAAN_-_02_\[9D948DC4\].mkv video-sink="navseek seek-offset=240 ! timeoverlay ! autovideosink" 2> 5.log && tail -n 1000 5.log > spew.log

you seek once and wait at least 3 minutes for the abort, depending on the frame you seek from it can take a decent amount of time. you can also just let it play from the beginning for at least 6 minutes (it _will_ abort, it just has to run through a bunch of frames, you cant seek right to the abort)

(file is easily located by name, and other videos in the series (aside from 01) exhibit the same problems in different places, ask if you need pointers, __tim on irc has it already)

tried with and without this patch from upstream http://trac.perian.org/browser/trunk/Patches/ffmpeg-larger-internal-buffer.diff

it makes aborts happen after a longer time, but they still occur

backtrace for aborted thread:

Thread 3 (Thread 0x7ffff02bb910 (LWP 5611))

  • #0 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #1 *__GI_abort
    at abort.c line 92
  • #2 ff_find_unused_picture
    at libavcodec/mpegvideo.c line 849
  • #3 MPV_frame_start
    at libavcodec/mpegvideo.c line 910
  • #4 ff_h264_frame_start
    at libavcodec/h264.c line 891
  • #5 decode_slice_header
    at libavcodec/h264.c line 1868
  • #6 decode_nal_units
    at libavcodec/h264.c line 2537
  • #7 decode_frame
    at libavcodec/h264.c line 2749
  • #8 avcodec_decode_video2
    at libavcodec/utils.c line 586
  • #9 avcodec_decode_video
    at libavcodec/utils.c line 572
  • #10 gst_ffmpegdec_video_frame
    at gstffmpegdec.c line 1728
  • #11 gst_ffmpegdec_frame
    at gstffmpegdec.c line 2205
  • #12 gst_ffmpegdec_chain
    at gstffmpegdec.c line 2620
  • #13 gst_pad_chain_data_unchecked
    at gstpad.c line 4130
  • #14 gst_pad_push_data
    at gstpad.c line 4359
  • #15 gst_pad_push
    at gstpad.c line 4463
  • #16 gst_single_queue_push_one
    at gstmultiqueue.c line 919
  • #17 gst_multi_queue_loop
    at gstmultiqueue.c line 1101
  • #18 gst_task_func
    at gsttask.c line 236
  • #19 default_func
    at gsttaskpool.c line 68
  • #20 g_thread_pool_thread_proxy
    at /build/buildd/glib2.0-2.22.3/glib/gthreadpool.c line 265
  • #21 g_thread_create_proxy
    at /build/buildd/glib2.0-2.22.3/glib/gthread.c line 635
  • #22 start_thread
    at pthread_create.c line 300
  • #23 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 112
  • #24 ??

Comment 1 Sebastian Dröge (slomo) 2010-03-15 16:25:27 UTC
Let's quote the sources here:

   /* We could return -1, but the codec would crash trying to draw into a
     * non-existing frame anyway. This is safer than waiting for a random crash.
     * Also the return of this is never useful, an encoder must only allocate
     * as much as allowed in the specification. This has no relationship to how
     * much libavcodec could allocate (and MAX_PICTURE_COUNT is always large
     * enough for such valid streams).
     * Plus, a decoder has to check stream validity and remove frames if too
     * many reference frames are around. Waiting for "OOM" is not correct at
     * all. Similarly, missing reference frames have to be replaced by
     * interpolated/MC frames, anything else is a bug in the codec ...
     */


If anything this is a bug in ffmpeg or in the file you're using. Could you file this bug against ffmpeg at https://roundup.ffmpeg.org ?
Comment 2 steubens 2010-03-15 19:41:18 UTC
the bug does not present itself in ffplay, only in combination with gstreamer, I've had this discussion several times with people on both sides, I should have posted the bug first, but I didn't, the way gst staggers frame releases eventually ends up with it holding too many outstanding frames and aborting
Comment 3 steubens 2010-03-21 03:37:46 UTC
i have a bit of a conundrum here now; i have some new material that aborts very fast and at the beginning of the file in the same manner, but it does NOT do it with HEAD at the time of this post, it still does it with the original file (Canaan), it should be easy to provide a sample of this new file; but it is not broken on HEAD, though they seem to touch the same bits (in the new file it aborts just before it hits a good 4 seconds of black frames)
Comment 4 steubens 2010-03-21 04:39:19 UTC
alright, i played the now working file in some silly attempt to actually watch it, and it aborts later even with HEAD, same problem; gst isn't releasing frames and ffmpeg is aborting eventually in _unused_picture
Comment 5 steubens 2010-03-21 04:49:31 UTC
its not a fix, and it'll eventually get hit again, but increasing the original value in the manner of ffmpeg-larger-internal-buffer.diff to 256 pushed it out

this by chance is hitting a lot of video files i actually want to watch and its a bit of a problem :|
Comment 6 Philip Withnall 2010-03-24 22:56:18 UTC
*** Bug 613848 has been marked as a duplicate of this bug. ***
Comment 7 Philip Withnall 2010-03-25 14:17:45 UTC
*** Bug 613916 has been marked as a duplicate of this bug. ***
Comment 8 Philip Withnall 2010-03-29 09:50:12 UTC
*** Bug 614227 has been marked as a duplicate of this bug. ***
Comment 9 steubens 2010-04-13 15:24:21 UTC
this doesn't happen if i use ximagesink, though there are _long_ pauses in the video at the same places it would abort() before, perhaps xvimagesink and the other sinks are accepting too many frames, and it eventually gets ahead of ffmpegs free frames?
Comment 10 steubens 2010-04-13 18:36:08 UTC
this bug seems slightly dependent on playback speed, more easily triggerable on slower machines, or machines that are just fast enough to play a given file; but not ones that play them without effort
Comment 11 bugreports 2010-04-13 18:52:36 UTC
NAK hmmhh, core 2 duo 3GHz here...
Comment 12 Akhil Laddha 2010-07-02 01:23:27 UTC
*** Bug 623305 has been marked as a duplicate of this bug. ***
Comment 13 Edward Hervey 2010-07-02 09:10:57 UTC
If people want us to investigate further into this issue we'll need:
* full GST_DEBUG=2,ffmpeg:5 log of failure
* new backtrace
* all of this using latest gst-ffmpeg pre-release (0.10.10.4) compiled with internal ffmpeg
Comment 14 steubens 2010-07-16 13:51:31 UTC
just watched the entire file i started this bug regarding, and it didn't do it at all; i'll have to report back when i've watched all of the rest of them, if you expect it to be fixed from your message, do you know what patch may have done it?
Comment 15 steubens 2010-07-19 11:14:43 UTC
just watched all of them, no aborts; though there was a LOT of judder after a pause that took a minute or two to work itself out (demuxer?)

dunno if its proper to close this bug with the dupes or anything, if anyone knows better go ahead and do so, will reopen if it ever occurs again
Comment 16 Tobias Mueller 2010-10-25 17:14:16 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for.
Thanks!