I am using following command to merge two live audio streams and also want to manage delay between streams:
ffmpeg -i rtmp://myIp:1935/live/stream1 -i rtmp:/myIp:1935/live/stream2 -codec:a aac -strict -2 -filter_complex "[1:a]adelay=3000[delay0];[0:a][delay0]amix" -ac 2 -f flv rtmp://myIp:1935/live/myStream
Now when I run above command then stream2 is 3 seconds delay than stream1. When I run this command again then this delay changes from 3 seconds to 4 or 5 seconds and it varies on every command run.
So is there any way I can manage this delay? as delay changes on every command run I can not give static delay time.