rtsp服务器推流音频,VLC播放没声音?

迷茫的蜉蝣 2023-02-14 15:43:45

不知道能不能碰巧遇到音视频大神!

 

问题如下:

音频格式:AAC,采样率:48000,自己写个rtsp服务器想要播放音频文件。

rtp头初始化如下:

rtp_head->version = 2;
rtp_head->p = 0;
rtp_head->x = 0;
rtp_head->cc = 0;
rtp_head->m = 1;
rtp_head->pt = 97;
rtp_head->seq = 0;
rtp_head->ts = 0;
rtp_head->ssrc = 0x88923423;

describe的时候回复的SDP媒体信息如下:

"v=0\r\n"
"o=- 9%ld 1 IN IP4 192.168.XXX.XXX\r\n"
"s=SDP TEST\r\n"
"t=0 0\r\n"
"a=control:*\r\n"
"m=audio 0 RTP/AVP 97\r\n"
"c=IN IP4 0.0.0.0\r\n"
"a=rtpmap:97 mpeg4-generic/48000/2\r\n"
"a=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1190\r\n"
"a=control:track0\r\n",

问题:

RTP载荷AAC RTP头+四字节载荷+AAC数据(去掉ADTS头的数据)

options describe setup play都成功了,VLC作为客户端也接收到数据啦!可是接收的数据只解码不播放:

该图为VLC音频流统计,修改sdp的config值能够显示已播放但是没声音。请问大概是什么原因? 

 

...全文
872 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

2,550

社区成员

发帖
与我相关
我的任务
社区描述
专题开发/技术/项目 多媒体/流媒体开发
社区管理员
  • 多媒体/流媒体开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧