Opened 17 months ago

Last modified 17 months ago

#7977 new defect

First frame of VFR coming out short

Reported by: electron.rotoscope Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: vsync
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:
When transcoding a variable framerate file using -vsync cfr and with a filtergraph, the first frame comes out a frame shorter than expected, which offsets the rest of the file. This doesn't happen when I don't have filters on, but I tried with setdar and drawtext so it doesn't seem to matter what filter is actually active.

Comparing builds from this happens with the 20190329-9dece05 build and up to the current, but not on the 20190328-f8fa8bb build and previous.

How to reproduce:

C:\current\bin\ffmpeg-20190328-f8fa8bb.exe -i "C:\current\testclip.mp4" -vsync cfr -filter_complex "[0:v] drawtext=:fontcolor=white:fontsize=18:text=\'\%%\{pts\}\'[vid]" -map "[vid]" "C:\current\"
C:\current\bin\ffmpeg-20190329-9dece05.exe -i "C:\current\testclip.mp4" -vsync cfr "C:\current\"
C:\current\bin\ffmpeg-20190329-9dece05.exe -i "C:\current\testclip.mp4" -vsync cfr -filter_complex "[0:v] drawtext=:fontcolor=white:fontsize=18:text=\'\%%\{pts\}\'[vid]" -map "[vid]" "C:\current\"
C:\current\bin\ffmpeg-20190329-9dece05.exe -i "C:\current\testclip.mp4" -vsync cfr -filter_complex "[0:v]setdar=4/3[vid]" -map "[vid]" "C:\current\"

Attachments (1)

testclip.mp4 (51.9 KB) - added by electron.rotoscope 17 months ago.
VFR test source file

Download all attachments as: .zip

Change History (2)

Changed 17 months ago by electron.rotoscope

VFR test source file

comment:1 Changed 17 months ago by Gyan

This is a result of 0ac3befd479877f11c795ecef8bf1ce2184c5a7a

And due to how the change was made, the affected stream does not actually have to pass through the filtergraph.

This produces the same changed result as well

ffmpeg -i testclip.mp4 -i SomeOtherAudio.wav -vsync cfr -filter_complex "[1:a]anullsink" out.mp4

Note: See TracTickets for help on using tickets.