Open rescue1155 opened 6 months ago
Hello,
If you only want audio you can try this way:
int bitrate = 128 * 1000;
int samplerate = 44100;
boolean isStereo = true;
RtspOnlyAudio rtspOnlyAudio = new RtspOnlyAudio(connectChecker);
//start stream
if (rtspOnlyAudio.prepareAudio(bitrate, samplerate, isStereo)) {
rtspOnlyAudio.startStream(url);
}
//stop stream
rtspOnlyAudio.stopStream();
Hello Pedro, I used RtspOnlyAudio with the Opus codec. The streaming works perfectly, but the audio file produced by the startRecord method is not playable. Is there a specific setting I need to adjust? Thanks!
Hello,
Record a file using opus is not allowed. The app should crash if you try to record using g711 or opus. This is a bug.
The reason is that the currents record controller implementations don't support g711 or opus.
You can create your own implementation to support it.
Maybe I can add an implementation for it. Maybe using a media muxer to create a webm or ogg file this can works
Hello,
I added a RecordController to allow record webm files that support Opus codec: https://github.com/pedroSG94/RootEncoder/commit/a069fa6438339a922ff81befc5a9eaeeeb72bd75
This will be available in the next version. Meanwhile you can copy that class and set the record controller using setRecordController. Remember save the file with name extension webm.
Hello,
Thank you very much, Pedro. The new RecordController solves my problem. Will it be possible to use Opus for video recording in the future?
Hello,
Webm only supports VP8 and VP9 video codecs so It will be possible only when I add support for those codecs.
I have plans to support at least VP9 in RTMP and RTSP but it is not a priority.
Hey there,
Is there any code sample in JAVA to use it with android audio recording and broadcast to RTSP server ?
thanks