I am trying to encode live rtmp stream via Libav library encoder by using avconv tool in following command -
avconv -timelimit 4000 -i rtmp://IP/live/file-name -shortest -s 176*144 -r 10 \
-b:v 56k -ab 12k -ac 1 -ar 22050 -f flv rtmp://IP/live/file-name_56
But audio is not synchronized with video in output stream, and video lags behind as its bit rate has been changed to 56 kbps. But audio bit rate doesn't change & current audio is audible.
I am playing it via Run Time Environment in Java and 1 hour video stops after 10 mins. This issue is there when I am running a thread in java to run avconv command as follows
public void run() {
try{
Thread.sleep(500);
Process pr= Runtime.getRuntime().exec("avconv -timelimit 4000 -i rtmp://IP/live/file-name -shortest -s 176*144 -r 10 -b:v 56k -ab 12k -ac 1 -ar 22050 -f flv rtmp://IP/live/file-name_56");
pr.waitFor();
}}
Kindly provide suggestion on this.