Skip to content
Snippets Groups Projects
Commit 2affbd3e authored by Leo Ma's avatar Leo Ma
Browse files

AAC HEv2 encoding


Signed-off-by: default avatarLeo Ma <begeekmyfriend@gmail.com>
parent e4ba70fa
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -138,6 +138,7 @@ public class SrsEncoder {
MediaFormat audioFormat = MediaFormat.createAudioFormat(ACODEC, ASAMPLERATE, ach);
audioFormat.setInteger(MediaFormat.KEY_BIT_RATE, ABITRATE);
audioFormat.setInteger(MediaFormat.KEY_MAX_INPUT_SIZE, 0);
audioFormat.setInteger(MediaFormat.KEY_AAC_PROFILE, MediaCodecInfo.CodecProfileLevel.AACObjectHE_PS);
aencoder.configure(audioFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
// add the audio tracker to muxer.
audioFlvTrack = flvMuxer.addTrack(audioFormat);
Loading
Loading
Loading
Loading
@@ -758,7 +758,7 @@ public class SrsFlvMuxer {
// 3bits left.
 
// samplingFrequencyIndex; 4 bslbf
byte samplingFrequencyIndex = 0x04;
byte samplingFrequencyIndex = 0x07;
if (asample_rate == SrsCodecAudioSampleRate.R22050) {
samplingFrequencyIndex = 0x07;
} else if (asample_rate == SrsCodecAudioSampleRate.R11025) {
Loading
Loading
@@ -792,8 +792,8 @@ public class SrsFlvMuxer {
aac_specific_config_got = true;
aac_packet_type = 0; // 0 = AAC sequence header
 
writeAdtsHeader(audio_tag.array(), 4);
audio_tag.appendOffset(7);
// writeAdtsHeader(audio_tag.array(), 4);
// audio_tag.appendOffset(7);
} else {
bb.get(audio_tag.array(), 2, bi.size);
audio_tag.appendOffset(bi.size + 2);
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment