[FFmpeg-trac] #11323(avfilter:new): soxr resampler assertion failure with precision>=30, specific duration values and loudnorm filter (was: soxr resampler assertion failure with precision>=30 and specific duration values)

FFmpeg trac at avcodec.org
Tue Nov 26 17:33:03 EET 2024


#11323: soxr resampler assertion failure with precision>=30, specific duration
values and loudnorm filter
------------------------------------+------------------------------------
             Reporter:  realies     |                    Owner:  (none)
                 Type:  defect      |                   Status:  new
             Priority:  normal      |                Component:  avfilter
              Version:  git-master  |               Resolution:
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+------------------------------------
Changes (by realies):

 * summary:
     soxr resampler assertion failure with precision>=30 and specific
     duration values
     =>
     soxr resampler assertion failure with precision>=30, specific duration
     values and loudnorm filter


Old description:

> Summary of the bug:
> FFmpeg crashes with "Assertion best_input >= 0 failed" when using soxr
> resampler with precision>=30 and duration values with 3 or more decimal
> places.
>
> How to reproduce:
> {{{
> # Minimal failing case:
> ffmpeg -filter_complex
> "sine=frequency=440:duration=65.706,aresample=44100:resampler=soxr:precision=33"
> output.wav
>
> # Error message:
> Assertion best_input >= 0 failed at fftools/ffmpeg_filter.c:2127
>
> # Working variations:
> 1. Same command with 2 decimal places works:
> ffmpeg -filter_complex
> "sine=frequency=440:duration=65.70,aresample=44100:resampler=soxr:precision=33"
> output.wav
>
> 2. Same command with default resampler works:
> ffmpeg -filter_complex
> "sine=frequency=440:duration=65.706,aresample=44100:precision=33"
> output.wav
>
> 3. Same command with lower precision works:
> ffmpeg -filter_complex
> "sine=frequency=440:duration=65.706,aresample=44100:resampler=soxr:precision=29"
> output.wav
>
> ffmpeg version N-117857-g2d077f9acd-20241121 Copyright (c) 2000-2024 the
> FFmpeg developers
> built with gcc 14.1.0 (crosstool-NG 1.26.0.93_a87bf7f)
> configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static
> --pkg-config=pkg-config --cross-prefix=x86_64-ffbuild-linux-gnu-
> --arch=x86_64 --target-os=linux --enable-gpl --enable-version3 --disable-
> debug --enable-iconv --enable-zlib --enable-libfreetype --enable-
> libfribidi --enable-gmp --enable-libxml2 --enable-openssl --enable-lzma
> --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-
> opencl --enable-libpulse --enable-libvmaf --enable-libxcb --enable-xlib
> --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth
> --enable-chromaprint --enable-libdav1d --enable-libdavs2 --enable-
> libdvdread --enable-libdvdnav --disable-libfdk-aac --enable-ffnvcodec
> --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar
> --enable-libaribcaption --enable-libass --enable-libbluray --enable-
> libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-
> libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2
> --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-
> libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-
> libopenmpt --enable-librav1e --enable-librubberband --disable-schannel
> --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1
> --enable-libtwolame --enable-libuavs3d --enable-libdrm --enable-vaapi
> --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-
> libplacebo --enable-libvvenc --enable-libx264 --enable-libx265 --enable-
> libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-
> cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-libs='-ldl -lgomp'
> --extra-ldflags=-pthread --extra-ldexeflags=-pie --cc=x86_64-ffbuild-
> linux-gnu-gcc --cxx=x86_64-ffbuild-linux-gnu-g++ --ar=x86_64-ffbuild-
> linux-gnu-gcc-ar --ranlib=x86_64-ffbuild-linux-gnu-gcc-ranlib --nm=x86_64
> -ffbuild-linux-gnu-gcc-nm --extra-version=20241121
> libavutil      59. 47.100 / 59. 47.100
> libavcodec     61. 25.102 / 61. 25.102
> libavformat    61.  9.100 / 61.  9.100
> libavdevice    61.  4.100 / 61.  4.100
> libavfilter    10.  6.101 / 10.  6.101
> libswscale      8.  9.101 /  8.  9.101
> libswresample   5.  4.100 /  5.  4.100
> libpostproc    58.  4.100 / 58.  4.100
> }}}
>
> Additional notes:
> - Issue occurs with precision values of 30-33
> - Issue only manifests with soxr resampler (default swresample works
> fine)
> - Duration values with 3+ decimal places trigger the failure

New description:

 Summary of the bug:
 FFmpeg crashes with "Assertion best_input >= 0 failed" when using soxr
 resampler with precision>=30 and duration values with 3 or more decimal
 places, but only when the loudnorm filter is present in the chain before
 the resampler.

 How to reproduce:
 {{{
 # Minimal failing case:
 ffmpeg -filter_complex
 "sine=frequency=440:duration=65.706,loudnorm,aresample=44100:resampler=soxr:precision=33"
 output.wav

 # Error message:
 Assertion best_input >= 0 failed at fftools/ffmpeg_filter.c:2127

 # Working variations:
 1. Same command with 2 decimal places works:
 ffmpeg -filter_complex
 "sine=frequency=440:duration=65.70,loudnorm,aresample=44100:resampler=soxr:precision=33"
 output.wav

 2. Same command with default resampler works:
 ffmpeg -filter_complex
 "sine=frequency=440:duration=65.706,loudnorm,aresample=44100:precision=33"
 output.wav

 3. Same command with lower precision works:
 ffmpeg -filter_complex
 "sine=frequency=440:duration=65.706,loudnorm,aresample=44100:resampler=soxr:precision=29"
 output.wav

 ffmpeg version N-117857-g2d077f9acd-20241121 Copyright (c) 2000-2024 the
 FFmpeg developers
 built with gcc 14.1.0 (crosstool-NG 1.26.0.93_a87bf7f)
 configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-
 config=pkg-config --cross-prefix=x86_64-ffbuild-linux-gnu- --arch=x86_64
 --target-os=linux --enable-gpl --enable-version3 --disable-debug --enable-
 iconv --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp
 --enable-libxml2 --enable-openssl --enable-lzma --enable-fontconfig
 --enable-libharfbuzz --enable-libvorbis --enable-opencl --enable-libpulse
 --enable-libvmaf --enable-libxcb --enable-xlib --enable-amf --enable-
 libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint
 --enable-libdav1d --enable-libdavs2 --enable-libdvdread --enable-libdvdnav
 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r
 --enable-libgme --enable-libkvazaar --enable-libaribcaption --enable-
 libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-
 libopus --enable-librist --enable-libssh --enable-libtheora --enable-
 libvpx --enable-libwebp --enable-lv2 --enable-libvpl --enable-openal
 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264
 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-
 librubberband --disable-schannel --enable-sdl2 --enable-libsoxr --enable-
 libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-
 libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-
 libshaderc --enable-libplacebo --enable-libvvenc --enable-libx264
 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg
 --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags=
 --extra-libs='-ldl -lgomp' --extra-ldflags=-pthread --extra-
 ldexeflags=-pie --cc=x86_64-ffbuild-linux-gnu-gcc --cxx=x86_64-ffbuild-
 linux-gnu-g++ --ar=x86_64-ffbuild-linux-gnu-gcc-ar --ranlib=x86_64
 -ffbuild-linux-gnu-gcc-ranlib --nm=x86_64-ffbuild-linux-gnu-gcc-nm
 --extra-version=20241121
 libavutil      59. 47.100 / 59. 47.100
 libavcodec     61. 25.102 / 61. 25.102
 libavformat    61.  9.100 / 61.  9.100
 libavdevice    61.  4.100 / 61.  4.100
 libavfilter    10.  6.101 / 10.  6.101
 libswscale      8.  9.101 /  8.  9.101
 libswresample   5.  4.100 /  5.  4.100
 libpostproc    58.  4.100 / 58.  4.100
 }}}

 Additional notes:
 - Issue occurs with precision values of 30-33
 - Issue only manifests with soxr resampler (default swresample works fine)
 - Duration values with 3+ decimal places trigger the failure
 - The loudnorm filter must be present in the chain before the resampler
 for the issue to occur

--
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11323#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list