Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1814600
  • 博文数量: 274
  • 博客积分: 2366
  • 博客等级: 大尉
  • 技术积分: 1880
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-22 09:37
文章分类

全部博文(274)

文章存档

2022年(1)

2020年(10)

2019年(7)

2018年(18)

2017年(26)

2016年(32)

2015年(43)

2014年(30)

2013年(44)

2012年(36)

2011年(17)

2010年(10)

分类: 其他平台

2014-02-27 20:23:12

SDP文件节选:
m=video 0 RTP/AVP 96
a=rtpmap:96 MP4V-ES/90000
a=control:trackID=0
a=mpeg4-esid:1
a=fmtp:96 profile-level-id=1; config=000001B0F4000001B50900000100000001200086C400670C5A1120518F;
m=audio 0 RTP/AVP 97
a=rtpmap:97 mpeg4-generic/44100/2
a=control:trackID=1
a=mpeg4-esid:3
a=fmtp:97 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1210; SizeLength=13; IndexLength=3; IndexDeltaLength=3;Profile=1;
 
 
音频:
audioObjectType:5
samplingFrequencyIndex:4
channelConfiguration:4 
reserve:3
 
代码:
UINT8 audioConfig[2] = {0};  
UINT8 const audioObjectType = profile + 1;  
audioConfig[0] = (audioObjectType<<3) | (samplingFrequencyIndex>>1);  
audioConfig[1] = (samplingFrequencyIndex<<7) | (channelConfiguration<<3);  
printf("%02x%02x", audioConfig[0], audioConfig[1]);
 
对本例来说:
audioObjectType = profile(1) + 1 = 0x02;
samplingFrequencyIndex = 0x04(44100)
channelConfiguration = 0x02(立体声)
故:
0 1 2 3|4 5 6 7|8 9 a b|c d e f
0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0
 
config= 1210,与文件中描述相符。
 
附:
sampling_frequency_index 
Table 35 – Sampling frequency dependent on sampling_frequency_index
sampling_frequency_index  sampling frequeny [Hz] 
0x0                       96000 
0x1                       88200 
0x2                       64000 
0x3                       48000 
0x4                       44100 
0x5                       32000 
0x6                       24000 
0x7                       22050 
0x8                       16000 
0x9                       12000 
0xa                       11025 
0xb                       8000 
0xc                       reserved 
0xd                       reserved 
0xe                       reserved 
0xf                       reserved 
阅读(5521) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~