-
-
Notifications
You must be signed in to change notification settings - Fork 781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audio & Video Sync Issue #1649
Comments
Hello, Did you tried using the clock to create the pts instead of calculate it based in the config?
Where presentTimeUs is (when you start encoder or receive the first frame):
|
Thanks @pedroSG94 I tried your logic for PTS calculation But in media live, the entire audio is playing like cracked audio. In local video its good. Basically I want the video and audio is in sync and also good. every file buffers need to reset the PTS. Is it any way to find the fps received in any class method? How could I achieve this custom implementation with audio and video good quality? Give me insights.
|
Hello, I have other possible solution. If you always have the same delay you can try change the start PTS to the audio artificially using your first way to calculate the PTS. |
Hi @pedroSG94 Audio and video is good and also in sync with 30FPS devices. For some devices FPA is low - 14 to 28, so audio and video not in sync. I am calculating VIDEO_FRAME_DURATION with static 30FPS value. Is it because of that? Is there any way to know frames received in a devices ? How could I calculate PTS value with support all the devices? |
Hello, You can try calculate only video PTS using the clock like this:
|
Hi @pedroSG94 My Custom Implementation is:
I am recording audio and video in file, mean while I am extending and modified AndroidMuxerRecordController class to get audio and video buffers. In my custom class I am receiving it in one method (onBuffervailable) Here based on my video frame count i am splitting chunks and writing in different file. Here I am resetting Buffer PTS value for each file. Kindly check below code. Audio and video is good in local video. But i my case when i am stetching those videos in mediaLive. The video is good but audio is playing bit delay. Its not in sync. Could you please help me How to set new PTS value for the buffers in one file with audio and video in sync?
`
`
The text was updated successfully, but these errors were encountered: