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

Extract audio and resample example #123

Open
expd opened this issue Mar 29, 2020 · 2 comments
Open

Extract audio and resample example #123

expd opened this issue Mar 29, 2020 · 2 comments

Comments

@expd
Copy link

expd commented Mar 29, 2020

Hi,

Can you provide an example of how to use the resampler to downsample an audio stream and get access to the raw pcm audio data?

@3d0c
Copy link
Owner

3d0c commented Mar 31, 2020

Hi, @expd. It's pretty easy, I'll writre it ASPA. The main thing is pretty the same you can find in trancode.go:

  • Open input context
  • Select AUDIO streams
  • Open output codecs (e.g. pcm_s16le)
  • Initialize Swr context
  • Do converrtion
  • Write output

Just wait a bit, and I'll write it.

@expd
Copy link
Author

expd commented Mar 31, 2020

I think some of the conversion functionality is missing
ffmpeg docs show that there's a different calculation for the number of samples required.
I'm trying to convert 48/stereo to 16/mono.

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