John
John

Reputation: 725

ffmpeg lavfi distorted audio

How to play audio at a normal rate?

First 2s play fine, then audio becomes distorted, it seems to speed up.

ffmpeg -f image2 -loop 1 -framerate 25 -i example.jpg -lavfi "amovie=sample.aac:loop=0" -f flv rtmp://192.168.99.100:1935/live/mystream2

Repeating audio with loop:0 returns `[flv @ 0000000000708220] Non-monotonous DTS in output stream 0:0;

audio: http://cdn.online-convert.com/example-file/audio/example.aac

Thank you.

Upvotes: 0

Views: 872

Answers (1)

Gyan
Gyan

Reputation: 92928

The amovie filter does not alter timestamps to make them continuous, upon loop. A setpts filter is needed.

ffmpeg -f image2 -loop 1 -framerate 25 -i example.jpg -f lavfi -i "amovie=sample.aac:loop=0,asetpts=N/SR/TB" -f flv rtmp://192.168.99.100:1935/live/mystream2

Upvotes: 1

Related Questions