Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 907953 - media-video/ffmpeg-5.1.3: floating point exception when trying to reencode a video with media-libs/svt-av1
Summary: media-video/ffmpeg-5.1.3: floating point exception when trying to reencode a ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2023-06-06 15:23 UTC by Kostadin Shishmanov
Modified: 2023-06-07 03:38 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kostadin Shishmanov 2023-06-06 15:23:23 UTC
I am getting "Floating point exception" when trying to reencode a video from h264  to av1 with svt-av1. The bug is no longer present in media-video/ffmpeg-6.0-r1 and media-video/ffmpeg-9999, so I am going to try to bisect which commit has fixed it. 

Command used to reproduce: 
ffmpeg -i Raindrops_Videvo.mp4 -c:v libsvtav1 -crf 35 test.mp4

Video used: https://www.videvo.net/video/raindrops-in-super-slow-motion/3313/

backtrace: 

#0  0x00007ffff648f5af in config_enc_params (avctx=0x5555555f0600, param=0x5555555f3908) at src/libavcodec/libsvtav1.c:182
#1  eb_enc_init (avctx=0x5555555f0600) at src/libavcodec/libsvtav1.c:364
#2  0x00007ffff65633a6 in avcodec_open2 (avctx=0x5555555f0600, codec=codec@entry=0x7ffff6f18a60 <ff_libsvtav1_encoder>, options=options@entry=0x5555555f0520) at src/libavcodec/avcodec.c:311
#3  0x000055555557f66e in init_output_stream (error_len=1024, error=0x7fffffffcbb0 "", frame=0x55555558902b, ost=0x0) at src/fftools/ffmpeg.c:3170
#4  init_output_stream_wrapper (ost=ost@entry=0x5555555f0380, frame=frame@entry=0x5555555f19c0, fatal=fatal@entry=1) at src/fftools/ffmpeg.c:820
#5  0x00005555555803ed in do_video_out (of=of@entry=0x5555555d9800, ost=ost@entry=0x5555555f0380, next_picture=next_picture@entry=0x5555555f19c0) at src/fftools/ffmpeg.c:1092
#6  0x000055555558101c in reap_filters (flush=flush@entry=0) at src/fftools/ffmpeg.c:1367
#7  0x0000555555584497 in transcode_step () at src/fftools/ffmpeg.c:4321
#8  transcode () at src/fftools/ffmpeg.c:4365
#9  0x000055555556079c in main (argc=<optimized out>, argv=<optimized out>) at src/fftools/ffmpeg.c:4560






emerge --info media-video/ffmpeg

media-video/ffmpeg-5.1.3::gentoo was built with the following:
USE="X bzip2 dav1d encode gnutls gpl iconv lcms mp3 network opengl opus postproc pulseaudio sdl svg svt-av1 threads truetype vaapi vorbis vulkan x264 xvid zlib -alsa -amf -amr -amrenc (-appkit) -bluray -bs2b -cdio -chromaprint -chromium -codec2 -cpudetection -cuda -debug -doc -fdk -flite -fontconfig -frei0r -fribidi -gcrypt -gme -gmp -gsm -hardcoded-tables -iec61883 -ieee1394 -jack -jpeg2k -jpegxl -kvazaar -ladspa -libaom -libaribb24 -libass -libcaca -libdrm -libilbc -libplacebo -librtmp -libsoxr -libtesseract -libv4l -libxml2 -lv2 -lzma (-mipsdspr1) (-mipsdspr2) (-mipsfpu) (-mmal) -modplug -nvenc -openal -opencl -openh264 -openssl -oss -pic -qsv -rav1e -rubberband -samba -snappy -sndio -speex -srt -ssh -static-libs -test -theora -twolame -v4l -vdpau -verify-sig -vidstab -vmaf -vpx -webp -x265 -zeromq -zimg -zvbi" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext sse sse2 sse3 sse4_1 sse4_2 ssse3 -3dnow -3dnowext -fma4 -xop" FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex trasher"
CFLAGS="-O2 -pipe -ggdb3"
CXXFLAGS="-O2 -pipe -ggdb3"
FEATURES="pid-sandbox multilib-strict strict splitdebug protect-owned news assume-digests installsources preserve-libs usersync unmerge-orphans unmerge-logs usersandbox config-protect-if-modified parallel-fetch binpkg-multi-instance xattr userfetch userpriv ipc-sandbox merge-sync distlocks fixlafiles sandbox binpkg-dostrip qa-unresolved-soname-deps ebuild-locks unknown-features-warn binpkg-docompress compressdebug buildpkg-live binpkg-logs sfperms network-sandbox"
Comment 1 Kostadin Shishmanov 2023-06-06 16:05:11 UTC
Bisect done. This is the first good commit: https://github.com/FFmpeg/FFmpeg/commit/96748ac54f998ba6fe22802799c16b4eba8d4ccc

Can confirm that applying the commit as a patch to media-video/ffmpeg-5.1.3 lets ffmpeg reencode the video without crashing.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-06 21:48:24 UTC
Nice, thanks.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-07 03:33:02 UTC
BtbN kindly backported this (and another commit) upstream.
Comment 4 Larry the Git Cow gentoo-dev 2023-06-07 03:38:46 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57a5e3b63c34414c772452044221be13e63e130a

commit 57a5e3b63c34414c772452044221be13e63e130a
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-06-07 03:37:42 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-06-07 03:37:42 +0000

    media-video/ffmpeg: backport (more) svt-av1 fixes
    
    Thanks to Kostadin for reporting & bisecting and thanks to BtbN for backporting
    the fix upstream for us on the 5.1 branch.
    
    Closes: https://bugs.gentoo.org/907953
    Signed-off-by: Sam James <sam@gentoo.org>

 media-video/ffmpeg/ffmpeg-5.1.3-r1.ebuild          | 601 +++++++++++++++++++++
 .../ffmpeg/files/ffmpeg-5.1.3-svt-av1.patch        |  67 +++
 2 files changed, 668 insertions(+)