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

how to record mp4 files in audio format g711a #1465

Open
lhf-Alice opened this issue Apr 28, 2024 · 2 comments
Open

how to record mp4 files in audio format g711a #1465

lhf-Alice opened this issue Apr 28, 2024 · 2 comments

Comments

@lhf-Alice
Copy link

No description provided.

@pedroSG94
Copy link
Owner

pedroSG94 commented Apr 28, 2024

Hello,

Currently the library has 2 ways to record files by default:
https://github.com/pedroSG94/RootEncoder/blob/master/library/src/main/java/com/pedro/library/util/AndroidMuxerRecordController.java
https://github.com/pedroSG94/RootEncoder/blob/master/library/src/main/java/com/pedro/library/util/AacMuxerRecordController.java
The first one is based on MediaMuxer class of Android and the second record AAC data directly in a file.

I think that MediaMuxer can't record with g711a codec. You can check it here (scroll a bit and you have a list of supported codecs):
https://developer.android.com/reference/android/media/MediaMuxer#addTrack(android.media.MediaFormat)
You can create your own muxer to support g711a. You only need create a class that extends from BaseRecordController class and implement your code in that class.
After that you need set this class to the library as the new BaseRecordController like this:

genericStream.setRecordController(CustomRecordController())

This allow you a way to record any codec in any file format with your own implementation

@pedroSG94
Copy link
Owner

You have a project developed by other user that maybe help you with that:
https://github.com/FunnyDevs/rtmp-rtsp-stream-client-java-recordcontrollers?tab=readme-ov-file
Since it is using FFMPEG to record (XugglerReccordController), maybe you can update the implementation to support your required codecs.

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