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.59k stars 1.06k forks source link

Youtube returning error when send rtmp push using OME #565

Closed pkhadson closed 2 years ago

pkhadson commented 2 years ago

My Server.xml https://gist.github.com/pkhadson/bac67abff2cd944300371d955c0505f8

I'am streaming with OBS: image

Error: image

getroot commented 2 years ago

Set the keyframe interval to less than 4 seconds as youtube said. You set keyframe interval to 0=auto (It may be very long)

Keukhan commented 2 years ago

I looked at the xml settings and the video track was transcoding to H264 and pushing Rtmp.

I tested it with the same settings and there is no problem.

image

Perhaps the server's performance is low, so transcoding cannot be performed in real time, or maybe your network speed is not good enough.

Thanks

Keukhan commented 2 years ago

Or try using the bypass option without live transcoding on the server. And, in obs, set the keyframe interval to 4 or less.

😀

pkhadson commented 2 years ago

Tks! But how can I disable transcoding?

Keukhan commented 2 years ago

<Video> <Bypass>false</Bypass> <Codec>h264</Codec> <Bitrate>2000000</Bitrate> <Framerate>30.0</Framerate> <Width>1280</Width> <Height>720</Height> </Video>

to `

true

`

easy :)

pkhadson commented 2 years ago

@Keukhan @getroot Thank you for the goodwill! But it wasn't enough to solve the problem.

getroot commented 2 years ago

If it doesn't work yet, please post new information. What does YouTube say? This works fine in my tests.

pkhadson commented 2 years ago

Youtube is returning: image

I'm sending the server ssh credentials @getroot @Keukhan. Feel free to change anything.

IP: 167.172.154.8 User: root Password: ometest

Thanks!

pkhadson commented 2 years ago

To start rtmpsend to youtube:


curl --request POST \
  --url http://167.172.154.8:8081/v1/vhosts/default/apps/app:startPush \
  --header 'Content-Type: application/json' \
  --header 'authorization: Basic cGsyMDIxMTAwN2hhZHNvbg==' \
  --data '{
  "id": "0",
  "stream": {
    "name": "stream",
  },
  "protocol": "rtmp",
  "url":"rtmp://x.rtmp.youtube.com/live2",
  "streamKey":"85yg-d6du-qc2k-gtbs-2hg1"
}'
getroot commented 2 years ago

Change the Keyframe Interval in OBS from 0 to 1 like I said before.

pkhadson commented 2 years ago

I changed, but it didn't solve

getroot commented 2 years ago

However, when video bypass transcoding is used, OME does nothing. Just send the input from OBS to Youtube as it is. And youtube tells you to shorten the keyframe interval.

Or the youtube error message you captured earlier is saying the bitrates are very low. Is your network speed or CPU good enough?

pkhadson commented 2 years ago

Yes, my CPU and network are fine. If I transmit from OBS directly to Youtube, the message does not appear

getroot commented 2 years ago

image

image

image

These captures are the results of testing on your server. Everything is normal.

pkhadson commented 2 years ago

Error happens 5 minutes after transmission starts

getroot commented 2 years ago

This is an issue that doesn't happen on other servers. You should check your server. The kernel version of your docker container is 5.4.0-888. On the other hand, the kernel version of our docker image (airensoft/ovenmediaenigne:latest) is 5.11.0-37. Linux kernels 5.3 to 5.6 have serious network bugs. (related to the epoll event). When posting a question, let us know what your environment is and how it differs from ours, so I can find the problem faster without having to look for it for an hour.

Check out several things. We have been using this feature in a commercial environment for 6 months without any problems.

pkhadson commented 2 years ago

OK! I will try on other servers. Thank you for your willingness. Thanks

getroot commented 2 years ago

Your docker container is OvenMediaEnigne 0.12.6. It is good to check if it is reproduced in the latest version (currently 0.12.8).

pkhadson commented 2 years ago

OvenMediaEngine is now running on the server without Docker. I've updated to the latest version but the same issue still occurs. I increased the server's resources and it didn't.

Keukhan commented 2 years ago

I'm sorry. I couldn't check because I was busy due to urgent work. As soon as possible, I'll figure out what the problem is.

Please wait a moment. :)

Thanks.

Keukhan commented 2 years ago

@pkhadson

Finally, I found the problem and solved it.

https://github.com/AirenSoft/OvenMediaEngine/compare/e34b81bdd34d...f7e198a4985a

Test it with the master branch code.

Thank you for the great report. :)