Roverr / rtsp-stream

Out of box solution for RTSP - HLS live stream transcoding. Makes RTSP easy to play in browsers.
MIT License
713 stars 166 forks source link

Stream can be viewed from VLC but not chromecast? #31

Open flinthamm opened 4 years ago

flinthamm commented 4 years ago

I can't find any other form of contact so my apologies in advance but I found your project and was immediately impressed. The trouble is having tried to restream x2 RTSP IPCCTV sources to HLS format, no matter what I try it has not been possible to send the URL to a ChromeCast.

The RTSP streams can be viewed from VLC(Windows) fine as can the re-streamed HLS but using Home Assistant to try and play the same URL on a local chromecast and the chromecast attempts to play the stream but fails silently.

I've used different media types HLS,application/x-mpegURL,application/vnd.apple.mpegurl

I've tries enabling your CORS environment variables and specifying the wildcard, although the default is to allow all anyway.

I've enabled debugging but this appears to just be for the FFMPEG streaming and this is working fine, which is also confirmed in the logs that are created. I guess I'm going to need wireshark to see what might be happening, if no one has any ideas?

I was hoping this might be something that someone has experience with but if not I will have to continue debugging.

I'm sorry I've not given more detailed explanation but I'm not even sure this will get looked at, so thought it was a good place to start _ Thank you.

Roverr commented 4 years ago

Hi @flinthamm,

I'm not sure if this issue has anything related to transcoding. As much as I know Chromecast doesn't deal with transcoding, it is focused around transferring the data correctly. The device you want to play your video on will be concerned about what type of video it has to deal with.

There are devices that can do both, but logically these are 2 different components. If your device is able to play HLS video (in theory), then your issue is most certainly not the transcoding but more likely it's networking.

flinthamm commented 4 years ago

Thank you for this follow-up it's very much appreciated. I'm going to try and do some packet monitoring with Wireshark this week and if I get anything useful, I'll update the comments here - if that's okay?

Roverr commented 4 years ago

Yeah sure feel free to document your thoughts.

flinthamm commented 4 years ago

Wireshark of course failed because any useful part of the conversation seems to get encrypted. It appears a custom receiver app would need to be written in order to access port 922 and do any useful debugging but maybe I'm wrong?

I must admit, mainly due to lack of knowledge and current time constraints I'm unable to get any further with this at the moment but just wanted to reach out to anyone that might be trying to do something similar or who might have more experience than me with Chromecasts default media player, debugging or perhaps someone who has even written a custom receiver for these devices?

I realise this is not the ideal place to be discussing this but just thought it was worth one last plea for any pointers that could get me heading in the right direction at least? Any and all help gratefully received ;)

Roverr commented 4 years ago

Unfortunately I'm also lacking time to give you proper help. I've read in some reddit posts that people had trouble with some companies' cameras and others worked right. I'm mostly working with hikvision, but we are not doing any chromecast support on the platform.

From 2016 Chromecast supports HLS so this should not be the problem. But once again, some people indicated issues with certain camera types. Therefore I think Chromecast gotta have network issues. A good test for this would be to deploy a proper environment to AWS or GCP with HTTPS support. Deploy a proper frontend player supporting Chromecasting to a CDN (with proper HTTPS support). Service should allow calls from that domain or from anything. If even in this environment it fails to play in chromecast it either has to be the camera stream or your device connecting to your local network. So another test could be to try to chromecast to another device in both environments. If both fails, then try with another camera, if both fails then our world is most certainly doomed my brother đŸ˜„

I'll leave this thread open to give a chance for someone who is more smarter than me to spot this issue and answer it potentially. (I'd not raise my hopes up, but why not)

poptix commented 2 years ago

Make sure you've enabled CORS and allow from *, particularly if you're using local network addresses.

Additionally, ensure that your video stream has an audio track. Chromecast requires your stream to have an audio track.