[FFmpeg-user] Audio/video stream are out of sync?

christina zou zou.christina at gmail.com
Wed Feb 8 23:57:03 EET 2017


I am trying to stream audio and video from my Pi to Youtube Live using
FFMPEG. My stream's audio and video are not syncing, because the audio is
perfectly realtime, but the video skips forward frequently.

Here is an example streamed video:

My Pi's upload speed is 5 Mbps and I'm using no more than 30% of CPU.

If I write to a FLV file instead of streaming to Youtube, the audio/video
sync is perfect.

I have tried params like -async 2, -vsync 2, and -re, but no improvement.
Any suggestions to improve the sync?

*My command:*

*sudo rm temp_audio.v*

*sudo rm temp_video.h264*

*mkfifo temp_audio.v*

*mkfifo temp_video.h264*

*arecord -Dmic_sv -c2 -r48000 -fS32_LE -twav temp_audio.v & \*

*raspivid -fps 10 -v -b 3000000 -o temp_video.h264 -t 0 & \*

~/special/ffmpeg/ffmpeg* \*

*    -framerate 10 \*

*    -re \*

*    -i temp_video.h264 \*

*    -i temp_audio.v \*

*    -ab 32k \*

*    -ac 2 \*

*    -c:v copy \*

*    -c:a aac \*

*    -report \*

*    -f flv **rtmp://*

More information about the ffmpeg-user mailing list