AgoraIO / API-Examples-Web

224 stars 199 forks source link

push stream to CDN fails with error code 451 #11

Closed stevepetersen closed 1 year ago

stevepetersen commented 3 years ago

Running the push stream to CDN demo from the web code (without changes) I get an error code:

AgoraRTCError LIVE_STREAMING_INVALID_ARGUMENT: data: {\"code\":451}

I've covered the channel and app id in the following log, but this shows the error. I've verified that the app ID includes the transcoding service and that the token and channel are correct (the host video shows up in my channel correctly).

Here is the log:

[Log] client leaves channel success (pushStreamToCDN.js, line 214)

"[client-29f87] Choose server https://webrtc2-ap-web-2.agoraio.cn/api/v1 failed, message: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: unable to allocate services in this area, retry: false"

{maxBitrate: undefined} "balanced"

[Log] publish success (pushStreamToCDN.js, line 111)

log (AgoraRTC_N.js:401:270)
error (AgoraRTC_N.js:399:382)
throw (AgoraRTC_N.js:404:522)
(anonymous function) (AgoraRTC_N.js:962:253)
asyncFunctionResume
(anonymous function)
promiseReactionJobWithoutPromise

[Error] live streaming error: – "AgoraRTCError LIVE_STREAMING_INVALID_ARGUMENT: " (anonymous function) (pushStreamToCDN.js:186) asyncFunctionResume (anonymous function) promiseReactionJobWithoutPromise promiseReactionJob

yoreland commented 3 years ago

just for a quick check, did you try the same on https://agoraio-community.github.io/AgoraWebSDK-NG/demo/pushStreamToCDN/index.html

stevepetersen commented 3 years ago

Yes just tried it, same result:

10:31:41:379 Agora-SDK [DEBUG]: – "[lock-safari-1] is created." log — AgoraRTC_N.js:40110:31:41:393 Agora-SDK [INFO]: – "browser compatibility" (2) "{\"getDisplayMedia\":true,\"getStreamFromExtension\":false,\"supportUnifiedPlan\":true,\"supportMinBitrate\":false,\"supportSetRtpSenderParameters\":true,\"supportDualStream\":false,\"webAudioMediaStreamDest\":true,\"supportReplaceTrack\":true,\"supportWebGL\":true,\"webAudioWithAEC\":true,\"supportRequestFrame\":true,\"supportShareAudio\":false}" "{\"name\":\"Safari\",\"version\":\"14\",\"os\":\"Mac OS X\"}" log — AgoraRTC_N.js:400:40410:31:41:396 Agora-SDK [DEBUG]: – "[lock-client-leave-2] is created." log — AgoraRTC_N.js:400:40410:31:41:396 Agora-SDK [DEBUG]: – "[lock-client-publish-3] is created." log — AgoraRTC_N.js:40110:31:41:397 Agora-SDK [INFO]: – "[client-7873b] Initializing AgoraRTC client v4.2.1 build: v4.2.1-0-gf505b57(12/23/2020, 5:25:33 PM), mode: live, codec: vp8" https://agoraio-community.github.io/favicon.icoFailed to load resource: the server responded with a status of 404 () https://agoraio-community.github.io/AgoraWebSDK-NG/demo/assets/bootstrap.min.css.mapFailed to load resource: the server responded with a status of 404 () https://agoraio-community.github.io/AgoraWebSDK-NG/demo/assets/bootstrap.bundle.min.js.mapFailed to load resource: the server responded with a status of 404 () https://download.agora.io/sdk/release/AgoraRTC_N-production.js.mapFailed to load resource: the server responded with a status of 404 (Not Found) log — AgoraRTC_N.js:40110:32:57:344 Agora-SDK [INFO]: – "[client-7873b] start join channel " log — AgoraRTC_N.js:40110:32:57:345 Agora-SDK [INFO]: – "[client-7873b] connection state change: DISCONNECTED -> CONNECTING" log — AgoraRTC_N.js:40110:32:57:353 Agora-SDK [INFO]: – "[client-7873b] set client role to host" log — AgoraRTC_N.js:400:40410:32:57:354 Agora-SDK [DEBUG]: – "[client-7873b] Connect to choose_server:" – "https://webrtc2-ap-web-1.agora.io/api/v1" log — AgoraRTC_N.js:400:40410:32:57:356 Agora-SDK [DEBUG]: – "[client-7873b] Connect to choose_server:" – "https://webrtc2-ap-web-2.agoraio.cn/api/v1" log — AgoraRTC_N.js:400:40410:32:57:530 Agora-SDK [DEBUG]: – "[gateway-client-7873b] start connect, url: wss://154-86-156-198.edge.agora.io:4710" log — AgoraRTC_N.js:401:14710:32:57:554 Agora-SDK [WARNING]: – "[client-7873b] Choose server https://webrtc2-ap-web-2.agoraio.cn/api/v1 failed, message: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: unabl…" log — AgoraRTC_N.js:400:40410:32:57:648 Agora-SDK [DEBUG]: – "[gateway-client-7873b] websocket opened:" – "wss://154-86-156-198.edge.agora.io:4710" log — AgoraRTC_N.js:40110:32:57:677 Agora-SDK [INFO]: – "[client-7873b] connection state change: CONNECTING -> CONNECTED" log — AgoraRTC_N.js:400:40410:32:57:678 Agora-SDK [DEBUG]: – "[client-7873b] Connected to gateway server" log — AgoraRTC_N.js:40110:32:57:679 Agora-SDK [INFO]: – "[client-7873b] Joining channel success: " log — AgoraRTC_N.js:40110:32:57:680 Agora-SDK [INFO]: – "start create microphone audio track with config" – "{}" – "trackId" – "track-d290f771" log — AgoraRTC_N.js:400:40410:32:57:681 Agora-SDK [DEBUG]: – "[track-d290f771] GetUserMedia" – "{\"audio\":{}}" log — AgoraRTC_N.js:400:40410:32:57:682 Agora-SDK [DEBUG]: – "[lock-safari-1] is locked, current queue 1." log — AgoraRTC_N.js:400:40410:32:57:704 Agora-SDK [DEBUG]: – "[client-7873b] user online" – 12883 log — AgoraRTC_N.js:400:40410:32:57:704 Agora-SDK [DEBUG]: – "[client-7873b] stream added with uid 12883, type video" log — AgoraRTC_N.js:40110:32:57:705 Agora-SDK [INFO]: – "[client-7873b] remote user 12883 published video" log — AgoraRTC_N.js:400:40410:32:57:706 Agora-SDK [DEBUG]: – "[lock-sub-12883-4] is created." log — AgoraRTC_N.js:40110:32:57:706 Agora-SDK [INFO]: – "[client-7873b] subscribe user 12883, mediaType: video" log — AgoraRTC_N.js:400:40410:32:57:707 Agora-SDK [DEBUG]: – "[lock-sub-12883-4] is locked, current queue 1." log — AgoraRTC_N.js:400:40410:32:57:716 Agora-SDK [DEBUG]: – "[client-7873b] stream added with uid 12883, type audio" log — AgoraRTC_N.js:40110:32:57:716 Agora-SDK [INFO]: – "[client-7873b] remote user 12883 published audio" log — AgoraRTC_N.js:40110:32:57:716 Agora-SDK [INFO]: – "[client-7873b] subscribe user 12883, mediaType: audio" log — AgoraRTC_N.js:400:40410:32:57:716 Agora-SDK [DEBUG]: – "[lock-sub-12883-4] is locked, current queue 2." log — AgoraRTC_N.js:400:40410:32:57:722 Agora-SDK [DEBUG]: – "[client-7873b-sub-1] create and set offer success" log — AgoraRTC_N.js:40110:32:57:723 Agora-SDK [INFO]: – "[client-7873b-sub-1] connection-state: sub p2p connecting" log — AgoraRTC_N.js:400:40410:32:57:756 Agora-SDK [DEBUG]: – "[client-7873b-sub-1] unused ontrack event audio" log — AgoraRTC_N.js:400:40410:32:57:756 Agora-SDK [DEBUG]: – "[client-7873b-sub-1] subscribe ontrack: video" (2) MediaStream {id: "UDACw29jSI", active: true, onaddtrack: null, onremovetrack: null, getAudioTracks: function, …} MediaStreamTrack {kind: "video", id: "8299f07e-ca54-4430-a28b-70002d0d3e8e", label: "remote video", enabled: true, contentHint: "", …} log — AgoraRTC_N.js:400:40410:32:57:758 Agora-SDK [DEBUG]: – "[client-7873b-sub-1] get all subscribed tracks" log — AgoraRTC_N.js:400:40410:32:57:758 Agora-SDK [DEBUG]: – "[client-7873b-sub-1] set answer success" log — AgoraRTC_N.js:40110:32:57:759 Agora-SDK [INFO]: – "[client-7873b-sub-1] ice-state: sub p2p checking" log — AgoraRTC_N.js:400:40410:32:57:795 Agora-SDK [DEBUG]: – "[pc-1] local candidate count" – 3 log — AgoraRTC_N.js:40110:32:57:859 Agora-SDK [INFO]: – "[client-7873b-sub-1] ice-state: sub p2p connected" log — AgoraRTC_N.js:40110:32:57:903 Agora-SDK [INFO]: – "[client-7873b-sub-1] create remote video track: track-454cf3fb" log — AgoraRTC_N.js:400:40410:32:57:905 Agora-SDK [DEBUG]: – "[lock-sub-12883-4] is not locked, current queue 1." log — AgoraRTC_N.js:40110:32:57:905 Agora-SDK [INFO]: – "[client-7873b] subscribe success user 12883, mediaType: video" pushStreamToCDN.js:218subscribe success log — AgoraRTC_N.js:400:40410:32:57:907 Agora-SDK [DEBUG]: – "[track-track-454cf3fb] start video playback" – "{}" log — AgoraRTC_N.js:400:40410:32:57:908 Agora-SDK [DEBUG]: – "[track-454cf3fb] video-element-status change none => init" log — AgoraRTC_N.js:400:40410:32:57:909 Agora-SDK [DEBUG]: – "[client-7873b-sub-1] update subscribe options [a: false, v: true] -> [a: true, v: true]" log — AgoraRTC_N.js:400:40410:32:57:910 Agora-SDK [DEBUG]: – "[client-7873b-sub-1] emit pc ontrack after subscribe audio" – MediaStreamTrack {kind: "audio", id: "b0d01ec7-5219-492f-8a39-c8ec6229a70f", label: "remote audio", …} log — AgoraRTC_N.js:40110:32:57:910 Agora-SDK [INFO]: – "create audio context" log — AgoraRTC_N.js:400:40410:32:58:39 Agora-SDK [DEBUG]: – "polyfill audio node" log — AgoraRTC_N.js:400:40410:32:58:40 Agora-SDK [DEBUG]: – "polyfill audio node" log — AgoraRTC_N.js:40110:32:58:41 Agora-SDK [INFO]: – "[client-7873b-sub-1] create remote audio track: track-8f116c19" log — AgoraRTC_N.js:400:40410:32:58:42 Agora-SDK [DEBUG]: – "[client-7873b] send subscribe change, audio: true, video: true" log — AgoraRTC_N.js:40110:32:58:42 Agora-SDK [INFO]: – "[client-7873b-sub-1] connection-state: sub p2p connected" log — AgoraRTC_N.js:40110:32:58:42 Agora-SDK [INFO]: – "[client-7873b-sub-1] ice-state: sub p2p completed" log — AgoraRTC_N.js:400:40410:32:58:43 Agora-SDK [DEBUG]: – "[track-454cf3fb] video-element-status change init => playing" log — AgoraRTC_N.js:400:40410:32:58:43 Agora-SDK [DEBUG]: – "[track-454cf3fb] video-element-status change playing => waiting" log — AgoraRTC_N.js:400:40410:32:58:69 Agora-SDK [DEBUG]: – "[track-454cf3fb] video-element-status change waiting => suspend" log — AgoraRTC_N.js:400:40410:32:58:70 Agora-SDK [DEBUG]: – "[lock-sub-12883-4] is not locked, current queue 0." log — AgoraRTC_N.js:40110:32:58:70 Agora-SDK [INFO]: – "[client-7873b] subscribe success user 12883, mediaType: audio" pushStreamToCDN.js:218subscribe success log — AgoraRTC_N.js:400:40410:32:58:70 Agora-SDK [DEBUG]: – "[track-8f116c19] start audio playback" log — AgoraRTC_N.js:40110:32:58:71 Agora-SDK [INFO]: – "detect webaudio autoplay failed" log — AgoraRTC_N.js:400:40410:32:58:276 Agora-SDK [DEBUG]: – "[track-454cf3fb] video-element-status change suspend => canplay" log — AgoraRTC_N.js:400:40410:32:58:276 Agora-SDK [DEBUG]: – "[track-454cf3fb] video-element-status change canplay => playing" log — AgoraRTC_N.js:400:40410:32:58:544 Agora-SDK [DEBUG]: – "[track-454cf3fb] current video dimensions:" – 640 – 480 log — AgoraRTC_N.js:400:40410:33:00:495 Agora-SDK [DEBUG]: – "[lock-safari-1] is not locked, current queue 0." log — AgoraRTC_N.js:400:40410:33:00:495 Agora-SDK [DEBUG]: – "[lock-track-d290f771-5] is created." log — AgoraRTC_N.js:400:40410:33:00:495 Agora-SDK [DEBUG]: – "polyfill audio node" log — AgoraRTC_N.js:400:40410:33:00:496 Agora-SDK [DEBUG]: – "polyfill audio node" log — AgoraRTC_N.js:40110:33:00:497 Agora-SDK [INFO]: – "create microphone audio track success, trackId:" – "track-d290f771" log — AgoraRTC_N.js:40110:33:00:498 Agora-SDK [INFO]: – "start create camera video track with config" – "{}" – "trackId" – "track-37f6f6fa" log — AgoraRTC_N.js:400:40410:33:00:498 Agora-SDK [DEBUG]: – "[track-37f6f6fa] GetUserMedia" – "{\"video\":{}}" log — AgoraRTC_N.js:400:40410:33:00:498 Agora-SDK [DEBUG]: – "[lock-safari-1] is locked, current queue 1." log — AgoraRTC_N.js:400:40410:33:02:669 Agora-SDK [DEBUG]: – "[lock-safari-1] is not locked, current queue 0." log — AgoraRTC_N.js:400:40410:33:02:669 Agora-SDK [DEBUG]: – "[lock-track-37f6f6fa-6] is created." log — AgoraRTC_N.js:40110:33:02:671 Agora-SDK [INFO]: – "create camera video success, trackId:" – "track-37f6f6fa" log — AgoraRTC_N.js:400:40410:33:02:672 Agora-SDK [DEBUG]: – "[track-track-37f6f6fa] start video playback" – "{}" log — AgoraRTC_N.js:400:40410:33:02:672 Agora-SDK [DEBUG]: – "[track-37f6f6fa] video-element-status change none => init" log — AgoraRTC_N.js:40110:33:02:679 Agora-SDK [INFO]: – "[client-7873b] Publishing tracks, id track-37f6f6fa ,track-d290f771 " log — AgoraRTC_N.js:400:40410:33:02:679 Agora-SDK [DEBUG]: – "[lock-client-publish-3] is locked, current queue 1." log — AgoraRTC_N.js:400:40410:33:02:679 Agora-SDK [DEBUG]: – "[client-7873b] publish high stream" log — AgoraRTC_N.js:400:40410:33:02:684 Agora-SDK [DEBUG]: – "[client-7873b-pub-2] add video track to pc" log — AgoraRTC_N.js:400:40410:33:02:762 Agora-SDK [DEBUG]: – "[client-7873b-pub-2] set pc rtp sender" (2) {maxBitrate: undefined} "balanced" log — AgoraRTC_N.js:400:40410:33:02:772 Agora-SDK [DEBUG]: – "[client-7873b-pub-2] add audio track to pc" log — AgoraRTC_N.js:400:40410:33:02:784 Agora-SDK [DEBUG]: – "[track-37f6f6fa] video-element-status change init => playing" log — AgoraRTC_N.js:400:40410:33:02:784 Agora-SDK [DEBUG]: – "[track-37f6f6fa] video-element-status change playing => waiting" log — AgoraRTC_N.js:400:40410:33:02:786 Agora-SDK [DEBUG]: – "[client-7873b-pub-2] create and set offer success" log — AgoraRTC_N.js:40110:33:02:789 Agora-SDK [INFO]: – "[client-7873b-pub-2] connection-state: pub p2p connecting" log — AgoraRTC_N.js:400:40410:33:02:789 Agora-SDK [DEBUG]: – "[track-37f6f6fa] video-element-status change waiting => suspend" log — AgoraRTC_N.js:400:40410:33:02:936 Agora-SDK [DEBUG]: – "[client-7873b-pub-2] set answer success" log — AgoraRTC_N.js:40110:33:02:937 Agora-SDK [INFO]: – "[client-7873b-pub-2] ice-state: pub p2p checking" log — AgoraRTC_N.js:400:40410:33:03:77 Agora-SDK [DEBUG]: – "[pc-2] local candidate count" – 4 log — AgoraRTC_N.js:40110:33:03:259 Agora-SDK [INFO]: – "[client-7873b-pub-2] ice-state: pub p2p connected" log — AgoraRTC_N.js:400:40410:33:03:261 Agora-SDK [DEBUG]: – "[lock-client-publish-3] is not locked, current queue 0." log — AgoraRTC_N.js:40110:33:03:261 Agora-SDK [INFO]: – "[client-7873b] Publish success, id track-37f6f6fa ,track-d290f771 " pushStreamToCDN.js:108publish success log — AgoraRTC_N.js:40110:33:03:262 Agora-SDK [INFO]: – "[client-7873b-pub-2] connection-state: pub p2p connected" log — AgoraRTC_N.js:40110:33:03:262 Agora-SDK [INFO]: – "[client-7873b-pub-2] ice-state: pub p2p completed" log — AgoraRTC_N.js:400:40410:33:04:490 Agora-SDK [DEBUG]: – "[lock-live-streaming-7] is created." log — AgoraRTC_N.js:400:40410:33:04:513 Agora-SDK [DEBUG]: – "[client-7873b] start live streaming https://cdn3.wowza.com/1/VXBkNGV2VEF4a2dV/WlA3Vmpr/hls/live/playlist.m3u8, mode: mix_streaming" log — AgoraRTC_N.js:400:40410:33:04:513 Agora-SDK [DEBUG]: – "[lock-live-streaming-7] is locked, current queue 1." log — AgoraRTC_N.js:400:40410:33:04:668 Agora-SDK [DEBUG]: – "[track-37f6f6fa] video-element-status change suspend => canplay" log — AgoraRTC_N.js:400:40410:33:04:669 Agora-SDK [DEBUG]: – "[track-37f6f6fa] video-element-status change canplay => playing" log — AgoraRTC_N.js:400:40410:33:04:785 Agora-SDK [DEBUG]: – "[track-37f6f6fa] current video dimensions:" – 640 – 480 log — AgoraRTC_N.js:400:40410:33:04:920 Agora-SDK [DEBUG]: – "[live-streaming] start connect, url: wss://148-153-163-20.edge.agora.io:30012?serviceName=mix_streaming" log — AgoraRTC_N.js:400:40410:33:05:304 Agora-SDK [DEBUG]: – "[live-streaming] websocket opened:" – "wss://148-153-163-20.edge.agora.io:30012?serviceName=mix_streaming" log — AgoraRTC_N.js:401:27010:33:05:394 Agora-SDK [ERROR]: – "AgoraRTCError LIVE_STREAMING_INVALID_ARGUMENT: data: {\"code\":451}" log — AgoraRTC_N.js:400:40410:33:05:395 Agora-SDK [DEBUG]: – "[lock-live-streaming-7] is not locked, current queue 0." pushStreamToCDN.js:183live streaming error: – "AgoraRTCError LIVE_STREAMING_INVALID_ARGUMENT: " Steve Petersen | Co-founder & CTO Riff | https://joinriff.com/j http://playlist.com/oinriff.com cell: 408-348-6765

On May 22, 2021, at 9:13 PM, xia ning @.***> wrote:

just for a quick check, did you try the same on https://agoraio-community.github.io/AgoraWebSDK-NG/demo/pushStreamToCDN/index.html https://agoraio-community.github.io/AgoraWebSDK-NG/demo/pushStreamToCDN/index.html — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AgoraIO/API-Examples-Web/issues/11#issuecomment-846498874, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQQKRJYRWXVCVGCZ4L44C3TPB6FHANCNFSM45K62IXA.

yoreland commented 3 years ago

Thanks for the information provided, seems your CDN url may have some issues, If using other url works fine. Do you have chance to use any other tool to stream with same url?

stevepetersen commented 3 years ago

Yes I have used this url with the OBS plugin and it works fine. I have also tried a few ivs endpoints that work with the obs plugin but not with this demo code.

Sent from my iPhone

On May 23, 2021, at 11:28 AM, xia ning @.***> wrote:

 Thanks for the information provided, seems your CDN url may have some issues, If using other url works fine. Do you have chance to use any other tool to stream with same url?

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

plutoless commented 3 years ago

hi @stevepetersen , unfortunately currently only rtmp/rtmps protocol is supported.

stevepetersen commented 3 years ago

I tried rtmp://62.113.210.250/medienasa-live/ok-merseburg_high rtmp://62.113.210.250/medienasa-live/ok-merseburg_high

This rtmp stream works in OBS, but I get the following error on https://agoraio-community.github.io/AgoraWebSDK-NG/demo/pushStreamToCDN/index.html https://agoraio-community.github.io/AgoraWebSDK-NG/demo/pushStreamToCDN/index.html

Here is the result:

log (AgoraRTC_N.js:401:270)
error (AgoraRTC_N.js:399:382)
throw (AgoraRTC_N.js:404:522)
(anonymous function) (AgoraRTC_N.js:962:253)
asyncFunctionResume
(anonymous function)
promiseReactionJobWithoutPromise

[Error] live streaming error: – "AgoraRTCError LIVE_STREAMING_CDN_ERROR: " (anonymous function) (pushStreamToCDN.js:183) asyncFunctionResume (anonymous function) promiseReactionJobWithoutPromise promiseReactionJob

Steve Petersen | Co-founder & CTO Riff | https://joinriff.com/j http://playlist.com/oinriff.com cell: 408-348-6765

On May 23, 2021, at 7:31 PM, Qianze Zhang @.***> wrote:

hi @stevepetersen https://github.com/stevepetersen , unfortunately currently only rtmp/rtmps protocol is supported.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AgoraIO/API-Examples-Web/issues/11#issuecomment-846689477, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQQKRLAJMKO24T5HZRZBYLTPG3A7ANCNFSM45K62IXA.

plutoless commented 3 years ago

have you turned on cdn streaming service in your dashboard console? https://docs.agora.io/en/Interactive%20Broadcast/cdn_streaming_web_ng?platform=Web

stevepetersen commented 3 years ago

We have enabled “RTMP converter” per this documentation: https://docs.agora.io/en/Interactive%20Broadcast/cdn_streaming_web?platform=Web https://docs.agora.io/en/Interactive%20Broadcast/cdn_streaming_web?platform=Web

Steve Petersen | Co-founder & CTO Riff | https://joinriff.com/j http://playlist.com/oinriff.com cell: 408-348-6765

On May 24, 2021, at 7:39 PM, Qianze Zhang @.***> wrote:

have you turned on cdn streaming service in your dashboard console? https://docs.agora.io/en/Interactive%20Broadcast/cdn_streaming_web_ng?platform=Web https://docs.agora.io/en/Interactive%20Broadcast/cdn_streaming_web_ng?platform=Web — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AgoraIO/API-Examples-Web/issues/11#issuecomment-847486585, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQQKRNIEWHFVWN5MXYTZ5TTPMEXZANCNFSM45K62IXA.