Skip to content
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 removed when changing video speed #2

Open
niklaspollonen opened this issue Feb 10, 2020 · 4 comments
Open

Audio removed when changing video speed #2

niklaspollonen opened this issue Feb 10, 2020 · 4 comments

Comments

@niklaspollonen
Copy link

The audio is removed when changing video speed on both Android and IOS. Any way to fix this for android?

For IOS, I recommend changing to this fork of SDAVAssetExportSession. It allows removing/changing of the pitch correction algorithm. The Audio speed can be easily activated by adding the same scaleTimeRange lines for the audioTrack and removing the !scaleTime from the if statement.

@selsamman
Copy link
Owner

Yes this could more easily be done on IOS where AVFoundation already supports time scaling. On Android we use the android-transcode library fork. Adding audio scaling to the android-transcode library is not on the horizon as it is quite complex to do properly. Having the same behavior on both platforms is a primary goal of this project.

@niklaspollonen
Copy link
Author

Have you checked on this library as an alternative: Natario Transcoder? Seems like it has audio stretching.

@selsamman
Copy link
Owner

Thanks for that. It has audio scaling but not transitions like crossfades which we support. Like the fork we are using it has deviated substantially from the original ypresto version so would not be something easily pulled. Curious as to your use case for time scaled audio.

@niklaspollonen
Copy link
Author

yeah, I need to read through the code in both libraries and learn from them.
I'm working on an audio app(that has video as an extra) so pitch changing is important to make interesting audio. I'm also doing native code to make the video editing faster, but its going a bit slowly on the android side. Therefore a demo is on the works with the tools available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants