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

need help! Audio stream with PCM to encode AAC #2464

Closed
JackMin1314 opened this issue Apr 28, 2023 · 4 comments
Closed

need help! Audio stream with PCM to encode AAC #2464

JackMin1314 opened this issue Apr 28, 2023 · 4 comments

Comments

@JackMin1314
Copy link

It's my first time to know pion, webrtc.

And I'm looking for find some methods or functions can encode audio stream with PCM to AAC in pion.
I know that use cgo to call some "xx.so" library like ffmpeg orfacc will be useful, but I still hope someone could give me some tips or functions in Pion.

Thanks!

@cedricve
Copy link

cedricve commented May 9, 2023

Looking for something similar, to be able to store audio in a MP4 container (next to WebRTCing)

@jianzhiyao
Copy link

Did you find any solution?

@cedricve
Copy link

I'm planning to work on it as part of the https://github.com/kerberos-io/agent. At the moment we confirm PCM is working for WebRTC, works great to be honest in the Kerberos Agent. However for recording in an MP4, you'll need AAC, therefore we requested some guidance.

We did some research and this is how we plan to do it:

  • We'll fetch the audio track from the RTSP stream
  • Check if it's PCM
  • Transcode to AAC on the fly (or when required) using FFmpeg or other transcoder
  • Write the new audio track to the MP4

This is just one part of the solution, you might also have cameras with no PCM, and only AAC codec onboard, therefore you'll need to cover the other end as well, as WebRTC only works with PCM and not AAC. This means you'll need to transcode AAC to PCM before adding it to your WebRTC audio track.

@Sean-Der
Copy link
Member

Sean-Der commented May 7, 2024

Hey @JackMin1314 @jianzhiyao @cedricve

Sorry Pion doesn't do more to make this easier! It would be nice to have a library that abstracts this away.

If I had to build this I would probably use something like https://github.com/gen2brain/aac-go or maybe GStreamer? If someone starts a library or puts up a repo happy to help!

@Sean-Der Sean-Der closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
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

4 participants