AirenSoft / OvenMediaEngine

OvenMediaEngine (OME) is a Sub-Second Latency Live Streaming Server with Large-Scale and High-Definition. #WebRTC #LLHLS
https://airensoft.com/ome.html
GNU Affero General Public License v3.0
2.58k stars 1.06k forks source link

RTMP(S) with Stunnel for Facebook Live screen audio missing #648

Closed younes200 closed 2 years ago

younes200 commented 2 years ago

PROBLEM Hi, Since OME does not yet support RTMPS, I'm relying on Stunnel to re-stream the feed to Facebook Live, but with the default stream output, the audio is missing and stream breaks every few seconds, facebook logs shows :

Facebook has not received video signal from the video source for some time. Check that the connectivity between the video source and Facebook is sufficient for the source resolution and bitrate. Check your video encoder logs for details. If problems persist, consider improving connection quality or reducing the bitrate of your video source.

When using this custom output profile that match facebook video/audio format (h264,aac) OME is not able to find the origin stream :

<OutputProfile>
    <Name>facebook_stream</Name>
    <OutputStreamName>${OriginStreamName}_facebook</OutputStreamName>
    <Encodes>
        <Video>
          <Bypass>false</Bypass>
          <Codec>h264</Codec>
          <Width>640</Width>
          <Bitrate>350000</Bitrate>
          <Framerate>30.0</Framerate>
        </Video>
      <Audio>
          <Bypass>false</Bypass>
          <Codec>aac</Codec>
          <Bitrate>128000</Bitrate>
          <Samplerate>48000</Samplerate>
          <Channel>2</Channel>
      </Audio>
    </Encodes>
</OutputProfile>    

OME returns this error in logs :

[2022-01-24 12:50:39.822] E [SPAPISvr-T8081:10] Orchestrator | orchestrator.cpp:478 | Could not find Origin for the stream: [#default#app/test_facebook]

I'm publishing the stream with the start push API:

curl --location --request POST 'https://api:8081/v1/vhosts/default/apps/app:startPush' \
--header 'authorization: Basic b21lLWFjY2Vzcy10b2tlbg==' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": "test",
    "stream": {
        "name": "test_facebook"
    },
    "protocol": "rtmp",
    "url": "rtmp://stunnel:19350/rtmp,
    "streamKey": "XXXX"
}'

ENVIRONMENTAL INFORMATION

using docker image : airensoft/ovenmediaengine:latest

Using OvenLiveKit for WebRTC publishing

Docker environment

Any help will be very appreciated Thank you.

getroot commented 2 years ago

Do you have "test" stream? Please upload full ovenmediaengine.log file

Keukhan commented 2 years ago

The set video bit rate is too low at 350 Kbps. That's why I think there's an error message on Facebook Live. Increase the bitrate value to more than 3 Mbps.

younes200 commented 2 years ago

Thank you very much for you quick answer, increasing the bit rate solves the problem 👍🏽