shogo4405 / HaishinKit.swift

Camera and Microphone streaming library via RTMP and SRT for iOS, macOS, tvOS and visionOS.
BSD 3-Clause "New" or "Revised" License
2.76k stars 612 forks source link

Audio doesn't play on streaming server for ReplayKit .audioApp. #1240

Closed xinhua01206 closed 1 year ago

xinhua01206 commented 1 year ago

Describe the bug

Hi @shogo4405.

Thanks for your crash fixing for ReplayKit.

This library works for video but the audio doesn't work on streaming server.

Followings are source code to test the app.

HaishinKit.xcodeproj.zip Examples.zip

You can replace the project file and example folder in your source code.

Thanks.

To Reproduce

  1. Launch the app.
  2. Tap the 'Stream off' button and it will stream the video and audio.

Expected behavior

Play the video and audio together on streaming server.

Version

1.5.3

Smartphone info.

Additional context

The library worked on version 1.3.0.

Screenshots

No response

Relevant log output

No response

xinhua01206 commented 1 year ago

Hi @shogo4405.

Thanks for your fixing ReplayKit audio problems. I can hear sound on rtmp server. But I can hear noise too. Could you please check this too? You can check it using above code.

Kind Regards.

shogo4405 commented 1 year ago

Hmm, I confirmed that ReplayKit @ ControlCenter is working fine, though. I am looking forward to your pull request with the fixes. Thank you very much!

xinhua01206 commented 1 year ago

@shogo4405.

I have tried to fix it but I am sorry I couldn't find the solution. Now audio is working well.

Thanks very much.

xinhua01206 commented 1 year ago

Hi @shogo4405.

The library is working well now. Thanks again.

For the 320 Kbps for audio bitrate, I am getting following error log.

[AudioConverter]        CodecConverter.cpp:1043  AudioCodecProduceOutputPackets returned 560100710
[AudioConverter]        CodecConverter.cpp:1030  Encoder client can't handle 1031-byte packet!
[AudioConverter]        CodecConverter.cpp:1043  AudioCodecProduceOutputPackets returned 560100710
[AudioConverter]        CodecConverter.cpp:1030  Encoder client can't handle 1031-byte packet!
[AudioConverter]        CodecConverter.cpp:1043  AudioCodecProduceOutputPackets returned 560100710
[AudioConverter]        CodecConverter.cpp:1030  Encoder client can't handle 1159-byte packet!

This show continuously. Can you please let me know what is wrong and how can I fix this?

Thanks.