#6593: Memory leaks in the dnxhd encoder
--------------------------------------+------------------------------------
Reporter: cehoyos | Owner:
Type: defect | Status: new
Priority: minor | Component: avcodec
Version: git-master | Keywords: dnxhd leak
Blocked By: | Blocking:
Reproduced by developer: 0 | Analyzed by developer: 0
--------------------------------------+------------------------------------
The dnxhd encoder leaks on failed initialization:
{{{
$ valgrind --leak-check=full ./ffmpeg_g -f rawvideo -s hd1080 -i /dev/zero
-thread_type slice -threads 32 -c:v dnxhd -b:v 36M -qmax 1 -f null -
==7232== Memcheck, a memory error detector
==7232== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==7232== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==7232== Command: ./ffmpeg_g -f rawvideo -s hd1080 -i /dev/zero
-thread_type slice -threads 32 -c:v dnxhd -b:v 36M -qmax 1 -f null -
==7232==
ffmpeg version N-86995-g28e9ba9 Copyright (c) 2000-2017 the FFmpeg
developers
built with gcc 6.3.0 (GCC)
configuration: --enable-gpl
libavutil 55. 74.100 / 55. 74.100
libavcodec 57.102.100 / 57.102.100
libavformat 57. 76.100 / 57. 76.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 99.100 / 6. 99.100
libswscale 4. 7.102 / 4. 7.102
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, rawvideo, from '/dev/zero':
Duration: N/A, start: 0.000000, bitrate: 622080 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080,
622080 kb/s, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> dnxhd (native))
Press [q] to stop, [?] for help
[dnxhd @ 0x851c480] Application has requested 32 threads. Using a thread
count greater than 16 is not recommended.
[dnxhd @ 0x851c480] qmax must be at least 2
Error initializing output stream 0:0 -- Error while opening encoder for
output stream #0:0 - maybe incorrect parameters such as bit_rate, rate,
width or height
Conversion failed!
==7232==
==7232== HEAP SUMMARY:
==7232== in use at exit: 321,581 bytes in 51 blocks
==7232== total heap usage: 2,131 allocs, 2,080 frees, 8,839,503 bytes
allocated
==7232==
==7232== 63 bytes in 1 blocks are definitely lost in loss record 3 of 21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x425F68: dnxhd_encode_init (dnxhdenc.c:216)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 80 bytes in 1 blocks are definitely lost in loss record 4 of 21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0xA1A7D8: ff_slice_thread_init (pthread_slice.c:144)
==7232== by 0xAF626D: avcodec_open2 (utils.c:822)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 126 bytes in 1 blocks are definitely lost in loss record 5 of 21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x425F4E: dnxhd_encode_init (dnxhdenc.c:214)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 272 bytes in 1 blocks are definitely lost in loss record 7 of 21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x42627D: dnxhd_encode_init (dnxhdenc.c:513)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 272 bytes in 1 blocks are definitely lost in loss record 8 of 21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x42629D: dnxhd_encode_init (dnxhdenc.c:515)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 512 bytes in 1 blocks are definitely lost in loss record 9 of 21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x425BDF: dnxhd_encode_init (mem.h:233)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 512 bytes in 1 blocks are definitely lost in loss record 10 of 21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x425C15: dnxhd_encode_init (mem.h:233)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 512 bytes in 1 blocks are definitely lost in loss record 11 of 21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x425C47: dnxhd_encode_init (mem.h:233)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 512 bytes in 1 blocks are definitely lost in loss record 12 of 21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x425C79: dnxhd_encode_init (mem.h:233)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 4,096 bytes in 1 blocks are definitely lost in loss record 14 of
21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x425F34: dnxhd_encode_init (mem.h:233)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 8,160 bytes in 1 blocks are definitely lost in loss record 15 of
21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x4262D4: dnxhd_encode_init (dnxhdenc.c:519)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 8,928 bytes in 31 blocks are possibly lost in loss record 16 of
21
==7232== at 0x4C292B8: calloc (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4010E69: allocate_dtv (in /lib64/ld-2.15.so)
==7232== by 0x401157D: _dl_allocate_tls (in /lib64/ld-2.15.so)
==7232== by 0x5897619: pthread_create@@GLIBC_2.2.5 (in
/lib64/libpthread-2.15.so)
==7232== by 0x10729D7: avpriv_slicethread_create (slicethread.c:151)
==7232== by 0xA1A7F9: ff_slice_thread_init (pthread_slice.c:145)
==7232== by 0xAF626D: avcodec_open2 (utils.c:822)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 16,320 bytes in 1 blocks are definitely lost in loss record 17 of
21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x4262BC: dnxhd_encode_init (dnxhdenc.c:517)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 16,384 bytes in 1 blocks are definitely lost in loss record 18 of
21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x425F0C: dnxhd_encode_init (mem.h:233)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 65,280 bytes in 1 blocks are definitely lost in loss record 19 of
21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x4261E6: dnxhd_encode_init (mem.h:233)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 65,280 bytes in 1 blocks are definitely lost in loss record 20 of
21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x42622D: dnxhd_encode_init (mem.h:233)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== 130,560 bytes in 1 blocks are definitely lost in loss record 21
of 21
==7232== at 0x4C290FE: memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind
/vgpreload_memcheck-amd64-linux.so)
==7232== by 0x105826F: av_mallocz (mem.c:87)
==7232== by 0x426191: dnxhd_encode_init (mem.h:233)
==7232== by 0xAF6457: avcodec_open2 (utils.c:1020)
==7232== by 0x49A3D8: init_output_stream.constprop.23 (ffmpeg.c:3469)
==7232== by 0x49F875: reap_filters (ffmpeg.c:1442)
==7232== by 0x480678: main (ffmpeg.c:4553)
==7232==
==7232== LEAK SUMMARY:
==7232== definitely lost: 308,941 bytes in 16 blocks
==7232== indirectly lost: 0 bytes in 0 blocks
==7232== possibly lost: 8,928 bytes in 31 blocks
==7232== still reachable: 3,712 bytes in 4 blocks
==7232== suppressed: 0 bytes in 0 blocks
==7232== Reachable blocks (those to which a pointer was found) are not
shown.
==7232== To see them, rerun with: --leak-check=full --show-reachable=yes
==7232==
==7232== For counts of detected and suppressed errors, rerun with: -v
==7232== ERROR SUMMARY: 23 errors from 19 contexts (suppressed: 2 from 2)
}}}
Similar for `ffmpeg -f rawvideo -s hd1080 -i /dev/zero -thread_type slice
-threads 33 -c:v dnxhd -b:v 36M -qmax 2 -f null -` and for invalid pix_fmt
- profile combinations.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/6593>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
#4401: Past duration too large
-------------------------------------+-------------------------------------
Reporter: ghazel | Type: defect
Status: new | Priority: normal
Component: | Version: git-
undetermined | master
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
ffmpeg spams "Past duration x.y too large" messages
How to reproduce:
{{{
ffmpeg version 2.6.1 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM
3.5svn)
}}}
I know some people might find this output desirable, but I do not. It
renders the output of ffmpeg basically unreadable, since there are so many
of them.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/4401>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
#7391: Raw .264 files cannot be muxed to MP4 anymore
-----------------------------------+--------------------------------------
Reporter: dustsigns | Type: defect
Status: new | Priority: normal
Component: ffmpeg | Version: git-master
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-----------------------------------+--------------------------------------
Summary of the bug: Muxing .264 files, even ones which have been created
by ffmpeg, cannot be muxed to playable MP4 files anymore.
How to reproduce:
{{{
% ffmpeg -s 352x288 -r 30 -i foreman.yuv foreman.264
[..]
% ffmpeg -i foreman.264 -vcodec copy foreman.mp4
ffmpeg version N-91715-gd71dfc087b Copyright (c) 2000-2018 the FFmpeg
developers
built with gcc 8.2.1 (GCC) 20180813
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-
fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-
libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-
amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora
--enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg
--enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-
libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex
--enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-
ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec
--enable-dxva2 --enable-avisynth
libavutil 56. 19.100 / 56. 19.100
libavcodec 58. 27.100 / 58. 27.100
libavformat 58. 17.103 / 58. 17.103
libavdevice 58. 4.101 / 58. 4.101
libavfilter 7. 26.100 / 7. 26.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
Input #0, h264, from 'foreman.264':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(progressive), 352x288, 30
fps, 30 tbr, 1200k tbn, 60 tbc
File 'foreman.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'foreman.mp4':
Metadata:
encoder : Lavf58.17.103
Stream #0:0: Video: h264 (High) (avc1 / 0x31637661),
yuv420p(progressive), 352x288, q=2-31, 30 fps, 30 tbr, 1200k tbn, 1200k
tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mp4 @ 00000226e8c79300] Timestamps are unset in a packet for stream 0.
This is deprecated and will stop working in the future. Fix your code to
set the timestamps properly
[mp4 @ 00000226e8c79300] pts has no value
Last message repeated 299 times
frame= 300 fps=0.0 q=-1.0 Lsize= 547kB time=00:00:09.90 bitrate=
452.7kbits/s speed=21.9x
video:544kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.705765%
}}}
The issue seems to be the lack of timestamps (possibly related to
https://trac.ffmpeg.org/ticket/502) However, even adding -fflags +genpts
and a frame rate via -r does not change the output, nor does it generate
an MP4 file that can be played back.
Older versions of ffmpeg did not have this issue. In particular, the
ffmpeg version that comes with Ubuntu 16.04 (ffmpeg 2.8.14) happily muxes
.264 files to MP4 with the commands above.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/7391>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker