deepch / RTSPtoWSMP4f

RTSP Stream to WebBrowser MSE over WebSocket based MP4f segments
229 stars 64 forks source link

Home Assistant Integration #50

Open tunerooster opened 1 year ago

tunerooster commented 1 year ago

Is it possible to use this application to stream .mp4 files to Home Assistant?

I am currently using AlexIT/WebRTC to stream from a camera (rtsp feed) and it is fast and smooth.

To stream an mp4 I am using <video src="https://...file.mp4">. It works but is very slow and choppy.

I am looking for an mp4 alternative which is smooth and fast. I currently use javascript to build custom html to stream to the video element, so I am hopeful that I can just replace the https://file.mp4 with a connection to an RTSPtoWSMP4f server.

But I don't want to try if it is not possible. If is is doable, any tips would be greatly appreciated.

Can anyone please advise? Thanks!

deepch commented 1 year ago

use mp4f and http server and write function

tunerooster commented 1 year ago

use mp4f and http server and write function

Is this what you mean by "use http server": (config.json)


  "server": {
    "http_port": ":8083"
  },
  "streams": {
    "H264_AAC": {
      "on_demand": false,
      "url": "https://mydomain.com/local/SampleVideo_1280x720_5mb.mp4"
    }
  }
}

When I run: GO111MODULE=on go run *.go I get the following:

[GIN-debug] Listening and serving HTTP on :8083
2022/09/04 18:23:47 dial tcp 174.10.17.169:554: i/o timeout
2022/09/04 18:23:48 H264_AAC Stream Try Connect
...Repeats indefinitely

NOTE: I have only HTTPS access to the server. Do I need something additional for HTTPS?

ALSO, I don't understand what you mean by: use "write function". Please elaborate a bit...

Thanks for your help!

P.S. If https is not supported, I am wondering if "file:" protocol is/could be supported? E.g.,

"url": "file:///home/homeassistant/SampleVideo_1280x720_5mb.mp4"
tunerooster commented 1 year ago

Anyone?