eerimoq / moblin

Moblin, a free iOS app for IRL streaming.
MIT License
140 stars 15 forks source link

Cloudflare Stream SRT #60

Open yasyf opened 1 month ago

yasyf commented 1 month ago

Hey! Will write up a proper report tomorrow but wanted to quickly note that SRT ingest URLs provided by Cloudflare Stream result in a connect-disconnect loop ad infinitum.

yasyf commented 1 month ago

Update: with other apps, switching from HEVC to H264 fixes the issue. With moblin however, the server kills the connection each time. I'm guessing there's something being sent that CF doesn't like. Logs attached.

Logs ``` Version: 0.352.0 Debug: false 3:27:03.787 PM Setting pixel format 420YpCbCr8BiPlanarFullRange 3:27:04.658 PM Thermal state is nominal 3:27:04.822 PM Mic: Bottom 3:27:04.825 PM inputFormat: 3:27:04.825 PM outputFormat: 3:27:04.843 PM Audio bitrate: 128000, maximum: 256000 3:27:04.869 PM Device not ready to zoom 3:27:05.177 PM cosmetics: Got 13 product(s) from App Store 3:27:05.177 PM cosmetics: Update my products from App Store 3:27:43.975 PM Device not ready to zoom 3:27:43.991 PM inputFormat: 3:27:43.991 PM outputFormat: 3:27:43.992 PM Audio bitrate: 128000, maximum: 256000 3:27:56.330 PM Device not ready to zoom 3:27:56.342 PM inputFormat: 3:27:56.342 PM outputFormat: 3:27:56.342 PM Audio bitrate: 128000, maximum: 256000 3:28:00.653 PM stream: Start 3:28:00.654 PM stream: State disconnected -> connecting 3:28:00.655 PM srtla: SRT instead of SRTLA: true 3:28:00.656 PM srtla: Any: Start 3:28:00.656 PM adaptive-bitrate: Using settings AdaptiveBitrateSettings(packetsInFlight: 200, rttDiffHighFactor: 0.9, rttDiffHighAllowedSpike: 50.0, rttDiffHighMinDecrease: 250000, pifDiffIncreaseFactor: 100000, minimumBitrate: 250000) 3:28:00.658 PM srtla: Any: State idle -> socketConnecting 3:28:00.658 PM srtla: Setting connect timer to 6.0 seconds 3:28:00.659 PM srtla: State idle -> waitForRemoteSocketConnected 3:28:00.660 PM srtla: Any: State change to preparing 3:28:00.693 PM srtla: Any: State change to ready 3:28:00.693 PM srtla: Any: State socketConnecting -> registered 3:28:00.694 PM srtla: State waitForRemoteSocketConnected -> waitForLocalSocketListening 3:28:00.696 PM srtla: State waitForLocalSocketListening -> running 3:28:00.697 PM Setting SRT latency to 2000 3:28:00.697 PM Setting SRT maxbw to 0 (follows input) 3:28:00.697 PM Setting SRT oheadbw to 25 3:28:00.825 PM SRT Socket Connected 3:28:00.825 PM ts-writer: Audio setup 3:28:00.826 PM stream: State connecting -> connected 3:28:03.026 PM SRT Socket Broken 3:28:03.026 PM stream: Disconnected with reason SRT disconnected 3:28:03.030 PM stream: State connected -> disconnected 3:28:03.031 PM srtla: Any: Stop with reason: Stopping stream (67 KB sent) 3:28:03.031 PM srtla: Any: State registered -> idle 3:28:03.032 PM srtla: State running -> idle 3:28:03.032 PM srtla: srtla deinit 3:28:03.033 PM srtla: Any: deinit remote connection 3:28:03.035 PM inputFormat: 3:28:03.035 PM outputFormat: 3:28:03.037 PM Audio bitrate: 128000, maximum: 256000 3:28:03.057 PM stream: Disconnected with reason SRT disconnected 3:28:03.057 PM stream: State disconnected -> disconnected 3:28:03.062 PM SRT Socket Not Exist 3:28:06.300 PM stream: Stop 3:28:06.301 PM stream: State disconnected -> disconnected 3:32:25.971 PM Device not ready to zoom 3:32:26.041 PM inputFormat: 3:32:26.041 PM outputFormat: 3:32:26.043 PM Audio bitrate: 128000, maximum: 256000 3:32:58.075 PM Device not ready to zoom 3:32:58.101 PM inputFormat: 3:32:58.101 PM outputFormat: 3:32:58.101 PM Audio bitrate: 128000, maximum: 256000 3:33:03.612 PM stream: Start 3:33:03.613 PM stream: State disconnected -> connecting 3:33:03.614 PM srtla: SRT instead of SRTLA: true 3:33:03.614 PM srtla: Any: Start 3:33:03.615 PM srtla: Any: State idle -> socketConnecting 3:33:03.615 PM srtla: Setting connect timer to 6.0 seconds 3:33:03.615 PM srtla: State idle -> waitForRemoteSocketConnected 3:33:03.616 PM adaptive-bitrate: Using settings AdaptiveBitrateSettings(packetsInFlight: 200, rttDiffHighFactor: 0.9, rttDiffHighAllowedSpike: 50.0, rttDiffHighMinDecrease: 250000, pifDiffIncreaseFactor: 100000, minimumBitrate: 250000) 3:33:03.617 PM srtla: Any: State change to preparing 3:33:03.632 PM srtla: Any: State change to ready 3:33:03.632 PM srtla: Any: State socketConnecting -> registered 3:33:03.634 PM srtla: State waitForRemoteSocketConnected -> waitForLocalSocketListening 3:33:03.637 PM srtla: State waitForLocalSocketListening -> running 3:33:03.642 PM Setting SRT latency to 2000 3:33:03.643 PM Setting SRT maxbw to 0 (follows input) 3:33:03.643 PM Setting SRT oheadbw to 25 3:33:03.856 PM SRT Socket Connected 3:33:03.856 PM ts-writer: Audio setup 3:33:03.857 PM stream: State connecting -> connected 3:33:06.044 PM SRT Socket Broken 3:33:06.045 PM stream: Disconnected with reason SRT disconnected 3:33:06.048 PM stream: State connected -> disconnected 3:33:06.049 PM srtla: Any: Stop with reason: Stopping stream (67 KB sent) 3:33:06.049 PM srtla: Any: State registered -> idle 3:33:06.049 PM srtla: State running -> idle 3:33:06.049 PM srtla: srtla deinit 3:33:06.050 PM srtla: Any: deinit remote connection 3:33:06.058 PM inputFormat: 3:33:06.058 PM outputFormat: 3:33:06.059 PM Audio bitrate: 128000, maximum: 256000 3:33:06.080 PM SRT Socket Not Exist 3:33:06.082 PM stream: Disconnected with reason SRT disconnected 3:33:06.082 PM stream: State disconnected -> disconnected 3:33:09.972 PM stream: Stop 3:33:09.973 PM stream: State disconnected -> disconnected 3:33:21.476 PM Device not ready to zoom 3:33:21.491 PM inputFormat: 3:33:21.491 PM outputFormat: 3:33:21.492 PM Audio bitrate: 128000, maximum: 256000 3:33:27.723 PM Device not ready to zoom 3:33:27.747 PM inputFormat: 3:33:27.747 PM outputFormat: 3:33:27.748 PM Audio bitrate: 128000, maximum: 256000 3:33:29.282 PM Device not ready to zoom 3:33:29.288 PM inputFormat: 3:33:29.289 PM outputFormat: 3:33:29.289 PM Audio bitrate: 128000, maximum: 256000 3:34:14.184 PM stream: Start 3:34:14.185 PM stream: State disconnected -> connecting 3:34:14.186 PM srtla: SRT instead of SRTLA: true 3:34:14.186 PM srtla: Any: Start 3:34:14.186 PM adaptive-bitrate: Using settings AdaptiveBitrateSettings(packetsInFlight: 200, rttDiffHighFactor: 0.9, rttDiffHighAllowedSpike: 50.0, rttDiffHighMinDecrease: 250000, pifDiffIncreaseFactor: 100000, minimumBitrate: 250000) 3:34:14.186 PM srtla: Any: State idle -> socketConnecting 3:34:14.186 PM srtla: Setting connect timer to 6.0 seconds 3:34:14.186 PM srtla: State idle -> waitForRemoteSocketConnected 3:34:14.187 PM srtla: Any: State change to preparing 3:34:14.200 PM srtla: Any: State change to ready 3:34:14.200 PM srtla: Any: State socketConnecting -> registered 3:34:14.200 PM srtla: State waitForRemoteSocketConnected -> waitForLocalSocketListening 3:34:14.202 PM srtla: State waitForLocalSocketListening -> running 3:34:14.213 PM Setting SRT latency to 2000 3:34:14.213 PM Setting SRT maxbw to 0 (follows input) 3:34:14.213 PM Setting SRT oheadbw to 25 3:34:14.407 PM SRT Socket Connected 3:34:14.408 PM ts-writer: Audio setup 3:34:14.408 PM stream: State connecting -> connected 3:34:16.588 PM SRT Socket Broken 3:34:16.588 PM stream: Disconnected with reason SRT disconnected 3:34:16.589 PM stream: State connected -> disconnected 3:34:16.590 PM srtla: Any: Stop with reason: Stopping stream (144 KB sent) 3:34:16.590 PM srtla: Any: State registered -> idle 3:34:16.590 PM srtla: State running -> idle 3:34:16.590 PM srtla: srtla deinit 3:34:16.591 PM srtla: Any: deinit remote connection 3:34:16.600 PM inputFormat: 3:34:16.600 PM outputFormat: 3:34:16.602 PM Audio bitrate: 128000, maximum: 256000 3:34:16.620 PM stream: Disconnected with reason SRT disconnected 3:34:16.620 PM stream: State disconnected -> disconnected 3:34:16.622 PM SRT Socket Not Exist 3:34:18.609 PM stream: Stop 3:34:18.610 PM stream: State disconnected -> disconnected 3:35:40.215 PM Device not ready to zoom 3:35:40.307 PM inputFormat: 3:35:40.307 PM outputFormat: 3:35:40.308 PM Audio bitrate: 128000, maximum: 256000 ```
eerimoq commented 1 month ago

What is the URL?

yasyf commented 1 month ago

@eerimoq srt://live.cloudflare.com:778?passphrase=xxx&streamid=xxx, I can give you an example one if helpful

yasyf commented 1 month ago

emailed one to you

eerimoq commented 1 month ago

I've never tested with a passphrase. Maybe that is the problem.

QayyoomArieff commented 1 week ago

I can confirm that using SRT with a passphrase results in very choppy and unwatchable video. When I remove the passphrase, the video becomes clear and viewable