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.


JLCPCB – Prototype 10 PCBs for $2 (For Any Color)

China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir