How to: RTSP to Chromecast

Hello

I am new and I have only one simple flow behind me (receive an http rquest, speak, on a case-by-case basis, some sentences on google home.

In my home I have surveillance cameras.
I can get the video with an rtsp link.
I would like to play this on my google home (with screen), which has a chromecast incorporated.

I wonder if this possible ?

I found this node


but in "stream a URL" it doesn't seem to accept a rtsp link.

Thank you

The stream is send directly to the cast device by using the castv2 protocol. Only these formats are supported; https://developers.google.com/cast/docs/media

Can you give an example ?

This flow doesn't work:

[{"id":"19d4447a.e78fcc","type":"tab","label":"Castv2","disabled":false,"info":""},{"id":"4ea4de1e.f255d","type":"castv2-sender","z":"19d4447a.e78fcc","name":"Smart Display","host":"192.168.1.113","x":540,"y":200,"wires":[["4200efb7.dfd73"]]},{"id":"4200efb7.dfd73","type":"debug","z":"19d4447a.e78fcc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":720,"y":200,"wires":[]},{"id":"bcb22075.677ec","type":"inject","z":"19d4447a.e78fcc","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":200,"wires":[["c86dad8.105995"]]},{"id":"c86dad8.105995","type":"change","z":"19d4447a.e78fcc","name":"","rules":[{"t":"set","p":"payload.media.url","pt":"msg","to":"rtsp://admin:1234@192.168.1.103:554/cam/realmonitor?channel=1&subtype=0","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"MEDIA","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":200,"wires":[["4ea4de1e.f255d"]]}]

I believe this is in the "change" I don't give the info it needs.

Thank you

Can someone give an example of a flow using castv2 node, streaming either a rtsp or a m3u8 file ? Documentation doesn't have an example.

Thank you

You have used not the node-red-contrib-cast node. So I can not help you.

In the website node-red-contrib-cast you can find examples for node-red-contrib-cast.

Hey, actually, in your first message I understood (misunderstood) you told me to use castV2 node.
Now I understand you say I need to use CAST node (knowing it uses castV2 protocol).
Is this correct ?

This cast node, I use it daily for TTS notifications (switching lights on/off, etc) !

So I come back to the "cast" node. In "media url" can I put a rtsp link ?

This flow (tried it with a rtsp link) does not work:

[{"id":"a32c41fb.c31c","type":"change","z":"19d4447a.e78fcc","name":"","rules":[{"t":"set","p":"ip","pt":"msg","to":"192.168.1.113","tot":"str"},{"t":"set","p":"url","pt":"msg","to":"rtsp://admin:1234@192.168.1.102:554/live","tot":"str"},{"t":"set","p":"contentType","pt":"msg","to":"video/mp4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":340,"wires":[["831444e1.916c78"]]}]

Working directly from a rtsp link would be my preferred option.

However an alternative, if this is not possible, is to use ffmpeg on my Pi (same one where I have nodered) to change the rtsp to m3u8 series of files. Then my question is how to read a file from the Pi (it is on the same device)

Thank you

I am the author of node node-red-contrib-cast. The node node node-red-contrib-castv2 is a fork created by anybody other. So I can not give any support for the castv2 node. But as I know both using the same protocoll and to thus both hase the same limitations.

Only media types are supported that Google lists here. There is nothing about rtsp stream. So this seems not be suported.

OK, well... The title of this discussion is "RTSP to chromecast" so well, yes, it is about RTSP actually... :grinning:
OK so you know nothing about that.

But M3U8 series of files do you know how to read it (M3U8 is listed in "CAST" node examples) ? How to read it on the same device (how to enter path) ? Do you know something about that ? (actually did you read the questions - no offense)

I think you'll find he does know something about it... having read the google support page you would find no mention of RTSP or M3U8 - so the answer is that Google don't support RTSP directly. You would need some other code in between to translate. A quick google finds several suggestions including ffmpeg, a pre-build docker container, etc... so there are solutions out there - but they are not built into Node-RED.

1 Like

Thank you. Actually a few messages above I explained, if RTSP is not possible, I already use FFMPEG on the Pi to change the stream to M3U8.
This is why I asked how to read M3U8 series of files with the cast node.
In the cast node page, there is mention of M3U8 in MEDIA types part.
=> I would like an example with this.
Among others I am curious about the file name and the path.

To be 100% complete, even better would be to have FFMPEG stream directly to the Chromecast but thtat I didn't figure out how to do this, and I am not on the right discussion board... But I am not sure this is possible anyway, without going through intermediate files.

Excuse me if my answer is too short.

So I come back to the "cast" node. In "media url" can I put a rtsp link ?

Any link can be entered in the media url field and the node will transmit this given link to the Cast device (e.g. chrome cast, google home, nest home, ...). The Node does only send the url and the additional context information (e.g. content type, etc...) to the cast device without changing them. To show the video/picture or play the sound it is up to the cast device itself.

The cast device is responsible for whether the desired result is achieved with the URL.
To thus as I answered before:

Only media types are supported that Google lists here. There is nothing about RTSP stream. So this seems not be suported.

Since Google unfortunately does not list RTSP as a supported format, I suspect that it will not work, but You can give it a try. (I have currently no possibility to test this.)

The other possibility is to only provide the video stream in a format that is supported by Google.

The documentation of the node is unfortunately not good here. With the formats listed in the documentation of the node, it is not guaranteed that Google also supports them. I will change the documentation in any of the next versions.

I hope that makes this more clear.

@Gleneroo - So... as the chromcast seems to accept HLS - then maybe the answer is to use ffmpeg to convert RTSP to HLS instead of M38U ?
eg - https://github.com/gihad/streamer

Thanks Hypnos for your more complete answer ! I do understand better what the node does and does not, and to refer to google doc and not node doc.

dceejay: Well, my understanding is HLS is M3U8.
I have ffmpeg on the pi taking the RTSP flow, and doing M3U8 files (*.ts files).
Now what I miss is the node to stream it to the chromecast.
Certainly I am not far.