harlanc / xiu

A simple,high performance and secure live media server in pure Rust (RTMP[cluster]/RTSP/WebRTC[whip/whep]/HTTP-FLV/HLS).🦀
https://rustxiu.com
MIT License
1.84k stars 198 forks source link

event_loop Subscribe error: no app or stream name #19

Closed fgadaleta closed 2 years ago

fgadaleta commented 2 years ago

In my scenario OBS is streaming to rtmp://127.0.0.1:1935/live/test And connection is correctly established

My config.toml is simply

[rtmp]
enabled = true
port = 1935

# pull streams from other server node.
[rtmp.pull]
enabled = false
address = "localhost"
port = 1935

[httpflv]
# true or false to enable or disable the feature
enabled = true
# listening port
port = 8081

[hls]
# true or false to enable or disable the feature
enabled = true
# listening port
port = 8080

But when I play the stream with any of the two below

ffplay -i rtmp://localhost:1935/live/test
ffplay -i http://localhost:8081/live/test.flv

I get 2 errors. One server side

event_loop Subscribe error: no app or stream name

and one client side

ffplay -i http://localhost:8081/live/test.flv
ffplay version 4.4-6ubuntu5 Copyright (c) 2003-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-7ubuntu1)
  configuration: --prefix=/usr --extra-version=6ubuntu5 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
http://localhost:8081/live/test.flv: Invalid data found when processing input
harlanc commented 2 years ago

Could you show me your OBS configuration GUI? I guess that your pushing configuration for RTMP app name and stream name are not "live" and "test"??

fgadaleta commented 2 years ago

they seem to be In OBS I set the server as rtmp://127.0.0.1:1935/live/test with an empty Stream key

harlanc commented 2 years ago

The server should be rtmp://127.0.0.1:1935/live and the stream key should be configured as test

fgadaleta commented 2 years ago

ok it works now thanks! Just with a delay of ~5 secs (both OBS and the server are running locally)

Both compiled debug and release (still the 5 sec lag)

harlanc commented 2 years ago

The latency is related to the push client GOP size and the play client buffer size.

fgadaleta commented 2 years ago

The latency is related to the push client GOP size and the play client buffer size.

I have OBS set as low-latency encoder settings (3000kbs) and I am playing with ffplay -i http://localhost:8081/live/test.flv

harlanc commented 2 years ago

What about your rtmp stream latency?try to add the “-fflags nobuffer” parameter for ffplay

fgadaleta commented 2 years ago

What's about your rtmp stream latency?try to add the “-fflags nobuffer” parameter for ffplay

even worse

harlanc commented 2 years ago

Did the ffplay print errors or warnings?

fgadaleta commented 2 years ago

Actually yes I get this in red

[h264 @ 0x7f806899e3c0] co located POCs unavailable
[h264 @ 0x7f8068b68380] co located POCs unavailable
harlanc commented 2 years ago

Now the default RTMP implemantation will cache 1 GOP which may increase the latency. I will do some improvements in the future to add this as a configuration.Then you can control to open the cache or not yourself.

fgadaleta commented 2 years ago

That would be a great fix indeed

Thank you