fyhertz / libstreaming

A solution for streaming H.264, H.263, AMR, AAC using RTP on Android
Apache License 2.0
3.49k stars 1.08k forks source link

Video-Audio lipsync #106

Open ckarthikv opened 9 years ago

ckarthikv commented 9 years ago

On a Kitkat phone, the video-audio sync doesn't seem to be perfect.

Is this a general issue of Libstreaming? I was having a look at the codebase and the frame-rate calculated is approximate for mediarecorder and Mediacodec_1 API.

Is the surface to buffer method the only way to ensure correct timestamps? Any help will be greatly appreciated. Thanks.

sbaar commented 9 years ago

The key to getting sync to work on wowza is to use an audio sample rate that your device prefers. On kitkat+ use String rate = ((AudioManager)context.getSystemService(Context.AUDIO_SERVICE)) .getProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE); I am using media codec, however. I think we should blame wowza for this, not libstreaming. On evostream it is not an issue.