Opened 9 hours ago

Last modified 2 hours ago

#11428 new defect

SIGFPE in xpsnr filter

Reported by: Ronald S. Bultje Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

How to reproduce:

$ ~/Projects/ffmpeg/x86-64-gpl/ffmpeg -i ~/Movies/cif/bus_cif.y4m -i x.ivf -lavfi '[0:v]settb=1/30,setpts=N[a];[1:v]settb=1/30,setpts=N[b];[a][b]xpsnr' -f null -
ffmpeg version N-118043-g2dc864eb4e Copyright (c) 2000-2024 the FFmpeg developers
  built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
  configuration: --enable-gpl --samples=/Users/ronaldbultje/Movies/fate-suite --enable-libvpx --enable-libaom --enable-ffplay --enable-sdl2 --enable-version3 --enable-libdav1d --enable-libx264 --enable-libx265 --disable-videotoolbox --enable-libvmaf
  libavutil      59. 49.100 / 59. 49.100
  libavcodec     61. 26.100 / 61. 26.100
  libavformat    61.  9.100 / 61.  9.100
  libavdevice    61.  4.100 / 61.  4.100
  libavfilter    10.  6.101 / 10.  6.101
  libswscale      8. 12.100 /  8. 12.100
  libswresample   5.  4.100 /  5.  4.100
  libpostproc    58.  4.100 / 58.  4.100
Input #0, yuv4mpegpipe, from '/Users/ronaldbultje/Movies/cif/bus_cif.y4m':
  Duration: 00:00:05.00, start: 0.000000, bitrate: 36496 kb/s
  Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p(progressive), 352x288, SAR 128:117 DAR 1408:1053, 30 fps, 30 tbr, 30 tbn
Input #1, ivf, from 'x.ivf':
  Duration: 00:00:03.34, start: 0.000000, bitrate: 341 kb/s
  Stream #1:0: Video: av1 (libdav1d) (Main) (AV01 / 0x31305641), yuv420p(tv), 352x288 [SAR 1:1 DAR 11:9], 29.97 tbr, 29.97 tbn
Stream mapping:
  Stream #0:0 (rawvideo) -> settb:default
  Stream #1:0 (libdav1d) -> settb:default
  xpsnr:default -> Stream #0:0 (wrapped_avframe)
Press [q] to stop, [?] for help
Floating point exception: 8

This is because xpsnr uses the framerate:
https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavfilter/vf_xpsnr.c;h=1b2c2a7c2c7a24da9494f4bddc9c1e368b5cb17a;hb=HEAD#l571
and this is reset in setpts and/or settb. Adding a fps=30 filter fixes it. I believe xpsnr uses fps to do 1st vs. 2nd order diffs (1st if fps<32, 2nd if fps>=32). But maybe it's meaningful to give users an alternative way to configure this distinction and not crash if the FPS is not set?

Change History (1)

comment:1 by Gyan, 2 hours ago

setpts was changed last year to unset outlink fps. This has broken some other workflows as well.
Best to add an option to make this user's choice.

Note: See TracTickets for help on using tickets.