[FFmpeg-devel] [PATCH] avformat/mov: fix hang while seek on a kind of fragmented mp4.

C.H.Liu liuchh83 at gmail.com
Sat Feb 23 09:22:08 EET 2019


I can’t reproduce the OOM. Is it possible the problem relate to a specific
clip?

Here is my test steps:
1. To ensure that it’s not affected by caches, delete all except the .git
dir in my code dir. Then checkout again.
2. To ensure that the latest test clips are used. make fate-rsync
SAMPLES=fate-suite/
3. To ensure that OS environment is clean, run test in docker.
Below is one of my test logs:

> /ffmpeg_src# valgrind --leak-check=full ./ffmpeg -i issue/dash.mp4  -map 0
> -f null -
>
> *==8552== Memcheck, a memory error detector*
> *==8552== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.*
> *==8552== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright
> info*
> *==8552== Command: ./ffmpeg -i issue/dash.mp4 -map 0 -f null -*
> *==8552== *
> *ffmpeg version 4.1.git Copyright (c) 2000-2019 the FFmpeg developers*
> *  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)*
> *  configuration: --samples=fate-suite/ --disable-doc --fatal-warnings
> --valgrind=VALGRIND*
> *  libavutil      56. 26.100 / 56. 26.100*
> *  libavcodec     58. 47.102 / 58. 47.102*
> *  libavformat    58. 26.101 / 58. 26.101*
> *  libavdevice    58.  6.101 / 58.  6.101*
> *  libavfilter     7. 48.100 /  7. 48.100*
> *  libswscale      5.  4.100 /  5.  4.100*
> *  libswresample   3.  4.100 /  3.  4.100*
> *Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'issue/dash.mp4':*
> *  Metadata:*
> *    major_brand     : iso5*
> *    minor_version   : 512*
> *    compatible_brands: iso6mp41*
> *    encoder         : Lavf58.20.100*
> *  Duration: 00:00:57.76, start: 0.000000, bitrate: 5193 kb/s*
> *    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
> smpte170m/bt709/bt709), 1280x720, 5125 kb/s, 25 fps, 25 tbr, 250k tbn, 50
> tbc (default)*
> *    Metadata:*
> *      handler_name    : VideoHandler*
> *    Stream #0:1(und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz,
> stereo, fltp, 79 kb/s (default)*
> *    Metadata:*
> *      handler_name    : SoundHandler*
> *Stream mapping:*
> *  Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))*
> *  Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))*
> *Press [q] to stop, [?] for help*
> *Output #0, null, to 'pipe:':ze=N/A time=-577014:32:22.77 bitrate=N/A
> speed=N/A    *
> *  Metadata:*
> *    major_brand     : iso5*
> *    minor_version   : 512*
> *    compatible_brands: iso6mp41*
> *    encoder         : Lavf58.26.101*
> *    Stream #0:0(und): Video: wrapped_avframe, yuv420p(progressive),
> 1280x720, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)*
> *    Metadata:*
> *      handler_name    : VideoHandler*
> *      encoder         : Lavc58.47.102 wrapped_avframe*
> *    Stream #0:1(und): Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
> (default)*
> *    Metadata:*
> *      handler_name    : SoundHandler*
> *      encoder         : Lavc58.47.102 pcm_s16le*
> *frame= 1438 fps=5.0 q=-0.0 Lsize=N/A time=00:00:57.68 bitrate=N/A
> speed=0.202x    *
> *video:753kB audio:9904kB subtitle:0kB other streams:0kB global
> headers:0kB muxing overhead: unknown*
> *==8552== *
> *==8552== HEAP SUMMARY:*
> *==8552==     in use at exit: 0 bytes in 0 blocks*
> *==8552==   total heap usage: 207,112 allocs, 207,112 frees, 121,288,827
> bytes allocated*
> *==8552== *
> *==8552== All heap blocks were freed -- no leaks are possible*
> *==8552== *
> *==8552== For counts of detected and suppressed errors, rerun with: -v**==8552==
> ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)*



BTW, below is my dockefile. It show that the installed dependences. And how
to configure and test.
*FROM ubuntu:18.04*

*RUN apt-get update -qq && apt-get dist-upgrade -qy*
*RUN apt-get -qy install autoconf automake build-essential cmake libass-dev
libfreetype6-dev libtool libvorbis-dev pkg-config texinfo zlib1g-dev \*
*  libnuma-dev*
*RUN apt-get -qy install yasm libx264-dev libx265-dev libfdk-aac-dev*
*RUN apt-get -qy install valgrind*

*COPY . /ffmpeg_src/*
*WORKDIR /ffmpeg_src*

*RUN make distclean*
*RUN ./configure --samples=fate-suite/ --disable-doc --fatal-warnings
--valgrind=VALGRIND*
*RUN make -j3 && make fate*

*CMD ["/bin/bash"]*


Michael Niedermayer <michael at niedermayer.cc> 于2019年2月23日周六 上午8:25写道:

> On Fri, Feb 22, 2019 at 06:20:40PM +0800, Charles Liu wrote:
> > 1. organize fragmented information according to the tracks.
> > 2. do NOT skip the last boxes of fragmented info.
> >
> > ticket #7572
> >
> > Signed-off-by: Charles Liu <liuchh83 at gmail.com>
> > ---
> >  libavformat/isom.h |  10 +-
> >  libavformat/mov.c  | 374 +++++++++++++++++++++------------------------
> >  2 files changed, 181 insertions(+), 203 deletions(-)
>
> still hitting out of memory and being killed by the kernel
> the other issue seems to be fixed though
>
> thx
>
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> The educated differ from the uneducated as much as the living from the
> dead. -- Aristotle
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list