aliakseis / FFmpegPlayer

Simple FFmpeg video player
MIT License
151 stars 44 forks source link

Video and audio are out of sync. #20

Open xixihao123 opened 5 years ago

xixihao123 commented 5 years ago

Hello, I use FFmpeg to stream local files to the Nginx server, and then use this player to play streaming media. The audio video is slightly out of sync(the sound is playing a little slow), but playing this video file directly is normal. May I ask what caused this?

aliakseis commented 5 years ago

Hi, there have been a bug fixed recently that is related to the sync stuff. Please check out the latest revision just in case.

xixihao123 commented 5 years ago

Hi, there seems to be a similar situation. I pushed the local MP4 file with FFmpeg. The server used NGINX and played it with player. The audio and video were out of sync。 cmd: ffmpeg -re -i 1.mp4 -vcodec copy -codec copy -f flv rtmp://127.0.0.1/live

aliakseis commented 5 years ago

Just an update. This is not an excuse for the bug, but an explanation - FFmpeg transforms a MP4 container to a FLV one, and, probably, along with this, ignores stream size: https://en.wikipedia.org/wiki/MPEG-4_Part_14 https://en.wikipedia.org/wiki/Flash_Video https://en.wikipedia.org/wiki/Real-Time_Messaging_Protocol