begeekmyfriend / yasea

RTMP live streaming client for Android
MIT License
4.87k stars 1.32k forks source link

从pc端发出来的直播信息,音频不是以AAC发出来的,app这边一直能看到画面但是播放不出来声音,是因为不支持除了AAC以外的其他格式么?能不能通过app转格式实现音频能播放 #821

Open lxz0329 opened 3 years ago

begeekmyfriend commented 3 years ago

这里是PCM数据送往安卓音频硬编码的接口。其实在SrsEncoder.java里面你可以自己设置硬编码参数

lxz0329 commented 3 years ago

因为现在的效果是用咱们的框架我自己推的视频是音频和视频都正常但是用pc开启直播间推流的时候我能看到画面但是听不到声音,这个问题是因为我们音频这块没有转成正确的格式导致的么?

在 2021-07-07 10:05:45,"Leo Ma" @.***> 写道:

这里是PCM数据送往安卓音频硬编码的接口。其实在SrsEncoder.java里面你可以自己设置硬编码参数

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

begeekmyfriend commented 3 years ago

你用ffplay都听不到,那就是格式错误,不然可以在播放器调整一下。

lxz0329 commented 3 years ago

vlc播放是正常的声音和画面都有但是就是在我们播放器里面是只能播放视频不能播放音频,我看SrsEncode这个类里面怎么处理拉过来的视频和音频能大概说下哪个配置么?

在 2021-07-07 11:31:43,"Leo Ma" @.***> 写道:

你用ffplay都听不到,那就是格式错误,不然可以在播放器调整一下。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

begeekmyfriend commented 3 years ago

刚才我在链接中已经给出了audio/mp4a-latm这个编码格式(M4A/AAC),你看一下安卓SDK还有其它定义吗?

lxz0329 commented 3 years ago

我把这个尝试改成audio/x-wav和audio/x-mpeg格式同样没有声音,

但是又看日志提示是不是这块影响的,但是由于没有研究过这块东西没看明白这是需要改什么呢

在 2021-07-07 14:32:18,"Leo Ma" @.***> 写道:

刚才我在链接中已经给出了audio/mp4a-latm这个编码格式(M4A/AAC),你看一下安卓SDK还有其它定义吗?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

xxxxxxbin6 commented 2 years ago

你好,现在如果将pcm编码成aac改成opus需要修改哪些

begeekmyfriend commented 2 years ago

需要你自己把libopus的库放到C代码里面去重新构建

xxxxxxbin6 commented 2 years ago

是的,主要是因为Webrtc不支持aac,使用libopus重建并且加到yasea里面估计工作量很大

begeekmyfriend commented 2 years ago

主要是我个人的职业已经迁移到了芯片音视频,安卓环境没有了,这个项目难以跟进。

xxxxxxbin6 commented 2 years ago

没事,我们决定尝试在服务器进行转码,谢谢回复!