-
-
Notifications
You must be signed in to change notification settings - Fork 791
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 I have a quick question. In Samsung F13 (Android 14), When I am using filters with timer running functionality, the FPS is not in consistent range(below 24), In AWS medialive, its showing 29 for input frame rate in health session. while recording, because of that, audio and video is not in sync. Without filters, its working fine. Please suggest me any way to resolve this issue. Other models are working as expected |
Hello, Sorry for late response Filters could reduce the fps depend the filter and device that you are using. |
Hi @pedroSG94 I am using AndroidViewFilterRender |
Ok, I will check if I can optimize it. |
Hi @pedroSG94 I am using FPS logic. But its working fine in all the models except this samsung F13. |
Yes, the reason is that Samsung F13 can't produce 30fps (as you said it is working with 24fps) and your method needs stable 30 FPS to work correctly. I recommend you adapt your method to fix it or use clock only for video because using the clock you don't have that problem |
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: