lakeinchina / librestreaming

Android real-time effect filter rtmp streaming library.using Mediacodec HWencoding&librtmp stream.
GNU Lesser General Public License v2.1
942 stars 317 forks source link

Sound/Image out of sync #205

Closed psegalen closed 5 years ago

psegalen commented 5 years ago

Hi @lakeinchina, thank you very much for this SDK! On some devices it seems the sound is out of sync with the image (720p @ 2.5 Mbps), sound is about 500ms ahead of image. Do you have any lead on how to address this issue?

lakeinchina commented 5 years ago

sorry,I am no longer working on this project. but this problem should be caused by presentationTimeUs in AudioSenderThread&VideoSenderThread,and this variable comes from nowTimeMs&drawMediaCodec() in RESSoftAudioCore&RESHardVideoCore.

Audio timestamp of this project is a bad design,maybe you should focus on it.

psegalen commented 5 years ago

Thank you for your answer and your insight about the problem, from what I could gather it seems that Camera1 API isn't suitable for what I need to achieve, I'll find another lib based on Camera2.