Opened 17 months ago

Closed 16 months ago

Last modified 16 months ago

#8824 closed defect (fixed)

vf_xfade softlocks filtergraph when crossfading different FPS video

Reported by: Stefan-Gabriel Muscalu Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: xfade
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:

When cross-fading from a 60fps video to a 5fps video, xfade locks up and stops processing frames, but keeps the filtergraph locked


ffmpeg version 4.3.1-static  Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100

How to reproduce:

ffmpeg -f lavfi -i testsrc=r=60:d=5 -f lavfi -i testsrc=r=5:d=5 -filter_complex "
	[1:v] setpts=PTS-STARTPTS,settb=AVTB [v1];
	[0:v] setpts=PTS-STARTPTS,settb=AVTB [v0];
	[v0][v1] xfade=duration=0.5:transition=wipeleft:offset=4.5
" test.mp4 -y

Another example of such behavior is when cross-fading between a 60fps video and a 7fps video, but instead of locking the filter-graph, it ends the stream early, outputting a 5.8s video instead of a 9.5s video:

ffmpeg -f lavfi -i testsrc=r=60:d=5 -f lavfi -i testsrc=r=7:d=5 -filter_complex "
	[1:v] setpts=PTS-STARTPTS,settb=AVTB [v1];
	[0:v] setpts=PTS-STARTPTS,settb=AVTB [v0];
	[v0][v1] xfade=duration=0.5:transition=wipeleft:offset=4.5
" test.mp4 -y

Change History (7)

comment:1 by Stefan-Gabriel Muscalu, 17 months ago

Cc: added

comment:2 by Stefan-Gabriel Muscalu, 17 months ago

Might be also related to ticket

comment:3 by Elon Musk, 17 months ago

Both tickets are invalid, xfade works with only inputs that have same valid fps.

comment:4 by Stefan-Gabriel Muscalu, 17 months ago

Ok, that invalidates this ticket, but 8823 is still valid as this example still reproduces it

ffmpeg -f lavfi -i testsrc=r=60:d=5 -f lavfi -i testsrc=r=60:d=5 -filter_complex "
	[1:v] setpts=PTS-STARTPTS,settb=AVTB,hue=90 [v1];
	[0:v] setpts=PTS-STARTPTS,settb=AVTB [v0];
	[v0][v1] xfade=duration=0.5:transition=wipeleft:offset=4.5
" test.mp4 -y

comment:6 by Elon Musk, 16 months ago

Resolution: fixed
Status: newclosed

comment:7 by Carl Eugen Hoyos, 16 months ago

Keywords: xfade added
Note: See TracTickets for help on using tickets.