Hello, I'm trying to synchronize video and audio from my raspicam and arecord and make rtmp stream with ffmpeg and 3g modem, but don't know how to do that. I have tried with this code: [code]raspivid -t 0 -w 1024 -h 768 -fps 25 -vf -hf -b 1000000 -v -o temp.v & arecord -f cd -D plughw:0 | ffmpeg -i temp.v -itsoffset 13.5 -i - -c:v copy -c:a libmp3lame -b:a 64k -vsync 0 -f flv rtmp://ipofmynginxserver/myapp/mystream[/code] and [code]raspivid -t 0 -w 1024 -h 768 -fps 25 -g 60 -vf -hf -b 1000000 -v -o temp.v & arecord -f cd -D plughw:0 | ffmpeg -r 25.37 -i temp.v -itsoffset 13.5 -i - -c:v copy -c:a libmp3lame -b:a 64k -vsync 0 -async 1 -f flv rtmp://ipofmynginxserver/myapp/mystream[/code] At first everything is fine (because of the offset) But after connection lost for 2-4 seconds audio and video starting to play asynchronus (audio first)
I have tried to change options vsync and async but it didn't make sense. If I'm trying to get alsa microphone with ffmpeg I'm getting alsa buffer xrun and it doesn't work, the only way for me is to use raspivid and arecord, how can I solve my problem? Thanks and sorry for my English.