AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
4.49k stars 361 forks source link

ffmpeg not working! #1070

Open canis-ferrin opened 5 months ago

canis-ferrin commented 5 months ago

Regarless what I am doing, following the instruction, I get a gray website wit a text in the upper left corner: mse:streans: exec: exit status 1 and a spiiner in the center of the page. What' wrong? config.yaml:

streams:
  Kamera127:
  - rtsp://admin:xxx@192.168.211.127:554/mpeg4cif
  - ffmpeg:Kamera127#video=mjpeg
  Kamera126: 
  - rtsp://192.168.211.126:554/user=admin&password=xxx&channel=1&stream=0.sdp#video=h264#rotate=90#width=400
  - ffmpeg:Kamera126#video=h264#rotate=90#-vf scale=w=640:h=360
    - ffmpeg:Kamera126#audio=opus           # only OPUS audio supported by HomeKit
log:
  level: info  # default level
  api: debug
  rtsp: debug
  streams: debug
  webrtc: debug
api:
  listen: ":1984"
  username: "admin"  # default "", Basic auth for WebUI
  password: "xxx"   # default "", Basic auth for WebUI
  base_path: ""
  static_dir: ""
  origin: ""
ffmpeg:
  bin: "ffmpeg"
  global: "-hide_banner"
  file: "-re -stream_loop -1 -i {input}"
  http: "-fflags nobuffer -flags low_delay -i {input}"
  rtsp: "-fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i {input}"
  output: "-user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output}"
  # ... different presets for codecs
srtp:
  listen: ":8443"
#streams: {}
webrtc:
  listen: ":8555"
  candidates: []
  ice_servers:
    - urls: [ "stun:stun.l.google.com:19302" ]
      username: ""
      credential: ""

I have to reduce bandwidth, Fully is not playing the video stream, Firefox does. How can I redude bandwidth and resolution?

AlexxIT commented 5 months ago

You can increase log level

canis-ferrin commented 5 months ago

The debug level log shows frequenty "[streams] can't stop none producer" what does it mean?

Log:

Time    Level   Message
30.4.2024, 13:31:56 info    go2rtc version 1.8.5 linux/arm
30.4.2024, 13:31:56 info    [api] listen addr=:1984
30.4.2024, 13:31:56 info    [rtsp] listen addr=:8554
30.4.2024, 13:31:56 info    [webrtc] listen addr=:8555
30.4.2024, 13:32:01 debug   [webrtc] new consumer src=Kamera127
30.4.2024, 13:32:02 debug   [webrtc] new consumer src=Kamera126
30.4.2024, 13:32:02 debug   [streams] start producer url=rtsp://192.168.211.126:554/user=admin&password=xxx&channel=1&stream=0.sdp#video=h264
30.4.2024, 13:32:02 debug   [streams] start producer url=rtsp://admin:xxx@192.168.211.127:554/mpeg4cif
30.4.2024, 13:32:02 debug   [streams] can't stop none producer
30.4.2024, 13:32:06 debug   [streams] can't stop none producer
30.4.2024, 13:32:33 debug   [webrtc] new consumer src=Kamera126
30.4.2024, 13:32:35 debug   [webrtc] new consumer src=Kamera127
30.4.2024, 13:32:35 debug   [streams] can't stop none producer
30.4.2024, 13:32:38 debug   [streams] can't stop none producer
30.4.2024, 13:32:48 debug   [streams] can't stop none producer
30.4.2024, 13:33:27 debug   [webrtc] new consumer src=Kamera126
30.4.2024, 13:33:36 debug   [webrtc] new consumer src=Kamera127
30.4.2024, 13:33:36 debug   [streams] can't stop none producer
30.4.2024, 13:33:38 debug   [streams] can't stop none producer
30.4.2024, 13:33:48 debug   [streams] can't stop none producer
30.4.2024, 13:33:49 debug   [webrtc] new consumer src=Kamera127
30.4.2024, 13:33:49 debug   [webrtc] new consumer src=Kamera126
30.4.2024, 13:33:50 debug   [streams] can't stop none producer
30.4.2024, 13:33:50 debug   [streams] can't stop none producer
30.4.2024, 13:33:55 debug   [streams] can't stop none producer
canis-ferrin commented 5 months ago

I defined an old Linksys WVC54GC mjpeg- webcanm as:

Kamera111:  "ffmpeg:http://admin:xanthippe@192.168.211.111/img/video.mjpeg#width200"

The stream is working, but width is still 640

AlexxIT commented 5 months ago

"can't stop none producer" means that the source failed to start by the time it needed to be stopped. It could be due to incorrect config or camera issues. For example, your config above is wrong