[FFmpeg-trac] #1900(avcodec:open): h264: huge memory allocation and a memleak (was: h264: huge memory allocation)
FFmpeg
trac at avcodec.org
Thu Nov 8 20:37:30 CET 2012
#1900: h264: huge memory allocation and a memleak
------------------------------------+-----------------------------------
Reporter: ami_stuff | Owner:
Type: defect | Status: open
Priority: normal | Component: avcodec
Version: git-master | Resolution:
Keywords: h264 leak | Blocked By:
Blocking: | Reproduced by developer: 1
Analyzed by developer: 0 |
------------------------------------+-----------------------------------
Changes (by cehoyos):
* status: new => open
* reproduced: 0 => 1
Comment:
No leak with -threads 1, memory usage rises to ~5G here with -threads 16
{{{
$ valgrind --leak-check=full ./ffmpeg_g -threads 2 -i h264.avi -f null -
==11415== Memcheck, a memory error detector
==11415== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==11415== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright
info
==11415== Command: ./ffmpeg_g -threads 2 -i h264.avi -f null -
==11415==
ffmpeg version N-46528-g5ff43ec Copyright (c) 2000-2012 the FFmpeg
developers
built on Nov 8 2012 19:27:34 with gcc 4.7 (SUSE Linux)
configuration: --enable-gpl --disable-indev=jack
libavutil 52. 5.100 / 52. 5.100
libavcodec 54. 71.100 / 54. 71.100
libavformat 54. 36.100 / 54. 36.100
libavdevice 54. 3.100 / 54. 3.100
libavfilter 3. 21.106 / 3. 21.106
libswscale 2. 1.102 / 2. 1.102
libswresample 0. 16.100 / 0. 16.100
libpostproc 52. 1.100 / 52. 1.100
[h264 @ 0x66ca000] missing picture in access unit with size 1941
[h264 @ 0x66ca000] no frame!
[h264 @ 0x66ca000] missing picture in access unit with size 2377
[h264 @ 0x66ca000] no frame!
[h264 @ 0x66ca000] missing picture in access unit with size 2090
[h264 @ 0x66ca000] no frame!
[h264 @ 0x66ca000] missing picture in access unit with size 2305
[h264 @ 0x66ca000] no frame!
[h264 @ 0x66ca000] missing picture in access unit with size 3280
[h264 @ 0x66ca000] no frame!
[h264 @ 0x66ca000] missing picture in access unit with size 2963
[h264 @ 0x66ca000] no frame!
[h264 @ 0x66ca000] missing picture in access unit with size 2624
[h264 @ 0x66ca000] no frame!
[h264 @ 0x66ca000] illegal log2_max_frame_num 50
[h264 @ 0x66ca000] missing picture in access unit with size 2937
[h264 @ 0x66ca000] illegal log2_max_frame_num 50
...
[h264 @ 0x66ca000] deblocking filter parameters 52 106 out of range
[h264 @ 0x66ca000] decode_slice_header error
[h264 @ 0x66ca000] concealing 297024 DC, 297024 AC, 297024 MV errors in P
frame
Input #0, avi, from 'h264.avi':
Duration: 00:00:12.64, start: 0.000000, bitrate: 788 kb/s
Stream #0:0: Video: h264 (H264 / 0x34363248), yuv420p, 19968x3808,
12.33 fps, 23.98 tbr, 23.97 tbn, 47.94 tbc
[h264 @ 0x6970d20] sps_id (32) out of range
Last message repeated 1 times
Output #0, null, to 'pipe:':
Metadata:
encoder : Lavf54.36.100
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 19968x3808,
q=2-31, 200 kb/s, 90k tbn, 23.98 tbc
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> rawvideo)
Press [q] to stop, [?] for help
[h264 @ 0x6970d20] no frame!
[h264 @ 0x6c160e0] no frame!
Error while decoding stream #0:0: Operation not permitted
[h264 @ 0x6970d20] no frame!
...
[h264 @ 0x6c160e0] decode_slice_header error
[h264 @ 0x6c160e0] no frame!
Error while decoding stream #0:0: Operation not permitted
[h264 @ 0x6970d20] Width/height/bit depth/chroma idc changing with threads
is not implemented. Update your FFmpeg version to the newest one from Git.
If the problem still occurs, it means that your file has a
feature which has not been implemented.
[h264 @ 0x6970d20] decode_slice_header error
[h264 @ 0x6970d20] no frame!
Error while decoding stream #0:0: Operation not permitted
frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=00:00:00.00 bitrate=
0.0kbits/s ^M
video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead -nan%
Output file is empty, nothing was encoded (check -ss / -t / -frames
parameters if used)
==11415==
==11415== HEAP SUMMARY:
==11415== in use at exit: 7,813,977 bytes in 28 blocks
==11415== total heap usage: 2,664 allocs, 2,636 frees, 2,495,641,669
bytes allocated
==11415==
==11415== 278,895 bytes in 1 blocks are definitely lost in loss record 1
of 2
==11415== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==11415== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==11415== by 0xBA6CC1: av_mallocz (mem.c:97)
==11415== by 0x98344B: av_fast_padded_malloc (utils.c:82)
==11415== by 0x76F6FD: ff_h264_decode_nal (h264.c:240)
==11415== by 0x774B1D: decode_nal_units (h264.c:3797)
==11415== by 0x775949: ff_h264_decode_extradata (h264.c:1056)
==11415== by 0x41DDFD: ff_h264_decode_init (h264.c:1104)
==11415== by 0x8DFD12: ff_thread_init (pthread.c:860)
==11415== by 0x987DEB: avcodec_open2 (utils.c:965)
==11415== by 0x461433: transcode_init (ffmpeg.c:1882)
==11415== by 0x450299: main (ffmpeg.c:2947)
==11415==
==11415== 7,535,082 bytes in 27 blocks are definitely lost in loss record
2 of 2
==11415== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==11415== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==11415== by 0xBA6CC1: av_mallocz (mem.c:97)
==11415== by 0x98344B: av_fast_padded_malloc (utils.c:82)
==11415== by 0x76F6FD: ff_h264_decode_nal (h264.c:240)
==11415== by 0x774B1D: decode_nal_units (h264.c:3797)
==11415== by 0x775DA2: decode_frame (h264.c:4117)
==11415== by 0x8DE245: frame_worker_thread (pthread.c:388)
==11415== by 0x55C6E0D: start_thread (in /lib64/libpthread-2.15.so)
==11415==
==11415== LEAK SUMMARY:
==11415== definitely lost: 7,813,977 bytes in 28 blocks
==11415== indirectly lost: 0 bytes in 0 blocks
==11415== possibly lost: 0 bytes in 0 blocks
==11415== still reachable: 0 bytes in 0 blocks
==11415== suppressed: 0 bytes in 0 blocks
==11415==
==11415== For counts of detected and suppressed errors, rerun with: -v
==11415== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 2 from 2)
}}}
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1900#comment:2>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list