-
Notifications
You must be signed in to change notification settings - Fork 27
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 added #51
base: master
Are you sure you want to change the base?
Audio added #51
Conversation
@PaulleDemon Let me explain the changes, if you can improve it.
If we play both these frames in this order, then they don't sync properly. But if we sort a small set of all these frames (one by one) according to their presentation time, we can directly play them without any delay as the audio is playing at the correct samplerate. Sorted like this:
Time stamp should be updated according to the audio time base (implemented) Some videos are already encoded with their correct pts, but the sort method I used will not affect those files. But sometimes it may show random stuttering with videos having variable frame rates, because we can't add all the frames at once (memory issue), and we can't seek back the decoding process, so some frames must be dropped. Other than this method, there is no good method to sync both audio/video with pyav. Moreover, one benefit of using pyaudio with the correct sample rate helps us avoid using the sleep method, you can treat the audio stream as the video clock. |
Ok, thanks for making this request, we'll keep this in beta for now. I just want one more confirmation from a developer using this library stating this has no major problems. I'll merge as soon as I get confirmation from one more dev, |
Added audio feature, please test it with different videos.
@PaulleDemon #2
What to test?
I have separated both methods, if we use audio=False it uses the old method to read frames. The audio method uses buffer storing.