Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#4766 closed defect (fixed)

Regression: Viewing avisynth files in ffplay is extremely laggy (A/V desync)

Reported by: nixx Owned by:
Priority: important Component: avformat
Version: git-master Keywords: avs regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


I have been using ffplay to preview Avisynth scripts before and it has worked reasonable well for a while, but I recently updated my ffmpeg executables and now the playback is extremely laggy, but only when the script has audio.

However, if I use

ffmpeg -f avisynth -i test.avs -c copy test.avi

and play the avi file, there is no lag whatsoever.

Even an extremely simple script like


exhibits this behavior.

To reproduce, install Avisynth (, make sure you install the same arch as your ffmpeg executables) and run

ffplay -f avisynth test.avs

Like I said, any avs script has this issue, but I will attach a test file nonetheless.

Attachments (1)

Avisynth test (380.8 KB) - added by nixx 4 years ago.

Download all attachments as: .zip

Change History (12)

Changed 4 years ago by nixx

comment:1 Changed 4 years ago by cehoyos

  • Keywords avs regression added
  • Priority changed from normal to important

Is the issue not reproducible with the following command?

$ ffmpeg -f avisynth -i test.avs -qscale 2 out.avi

comment:2 Changed 4 years ago by nixx

ffmpeg still encodes avs files just fine, it's only ffplay that seems to have any issues.

comment:3 Changed 4 years ago by cehoyos

Please run "git bisect" to find the change introducing the issue.

comment:4 Changed 4 years ago by nixx

Unfortunately I do not have a development environment capable of compiling ffmpeg, so I can't give you any exact information regarding when the bug was introduced.

All I know is that the months old build I was using did not have this problem.

comment:5 Changed 4 years ago by cus

Well I suspect b1f78632c681f32c4901a85aa7ee72bf9ca6fece, altough I don't quite see why.

Could you try the zeranoe builds from 20150805 ?

comment:6 Changed 4 years ago by nixx

The build I was using was from 20150803, so I don't think that would be it.

You made me take a closer look at the zeranoe page and notice the previous builds link though, so I will see if I can find where it starts happening.

comment:7 Changed 4 years ago by nixx

After testing different zeranoe builds, it seems like this bug was introduced between 33c752be513d09d9dd498beac02c39522d671888 (20140919) and 3fe962940f1e8fd2f1881c0cee646bd0e52ab204 (20140924).

Last edited 4 years ago by nixx (previous) (diff)

comment:9 Changed 4 years ago by cus

It seems avisynth is not setting codec packet timebase.

I have sent a patch to ffmpeg-devel which should fix this.

comment:10 Changed 4 years ago by cehoyos

  • Component changed from ffplay to avformat
  • Resolution set to fixed
  • Status changed from new to closed

Fixed by Marton Balint in 8009a1f1fdce16a59ea911e2b768e56ec4c8e344
Thank you for the report!

comment:11 Changed 4 years ago by nixx

I can confirm that it's fixed now. Thank you all for the quick responses.

Note: See TracTickets for help on using tickets.